Java

From NixOS Wiki
Revision as of 12:01, 19 March 2018 by imported>Makefu (→‎Using Oracle JDK instead of Open JDK)

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