Java: Difference between revisions

From NixOS Wiki
imported>Mic92
add java page
 
imported>Makefu
Line 1: Line 1:
This article is about [https://en.wikipedia.org/wiki/Java_(programming_language) Java], the programming language.
This article is about [https://en.wikipedia.org/wiki/Java_(programming_language) Java], the programming language.
__TOC__


== Using Oracle JDK instead of Open JDK ==
== Using Oracle JDK instead of Open JDK ==

Revision as of 12:01, 19 March 2018

This article is about Java, the programming language.

Using Oracle JDK instead of Open JDK

Almost all Java packages in nixpkgs use Open JDK in form of a jre dependency. If you use Oracle JDK and also want other applications to use it, you can simply tweak your .nixpkgs/config.nix so that your desired application uses Oracles JDK or JRE.

Example with UMLet with JRE

{
  allowUnfree = true;
  packageOverrides = pkgs: rec {
    umlet = pkgs.umlet.override {
      jre = pkgs.oraclejre8;
    };
  };
}

Better font rendering

By default java does not enable antialiasing for font rendering. By exporting environment variables, this can be fixed:

Example with UMLet with JRE 8:

$ export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'

More options can be found in the archlinux wiki