Java: Difference between revisions

From NixOS Wiki
imported>Makefu
imported>Mic92
remove out-of-place sentence
Line 22: Line 22:
By default java does not enable antialiasing for font rendering. By exporting environment variables, this can be fixed:
By default java does not enable antialiasing for font rendering. By exporting environment variables, this can be fixed:


Example with UMLet with JRE 8:
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
$ export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'
$ export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'

Revision as of 12:03, 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:

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

More options can be found in the archlinux wiki