{"id":60,"date":"2021-01-12T09:26:41","date_gmt":"2021-01-12T09:26:41","guid":{"rendered":"https:\/\/veltzer.net:8890\/?p=60"},"modified":"2021-01-12T09:26:41","modified_gmt":"2021-01-12T09:26:41","slug":"java-runtime-environment-control","status":"publish","type":"post","link":"https:\/\/veltzer.net:8890\/java-runtime-environment-control\/","title":{"rendered":"Java runtime environment control"},"content":{"rendered":"\n
There are four ways to control Java environment for runtime:<\/p>\n\n\n\n
Examples of them can be:<\/p>\n\n\n\n
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'<\/code><\/li>java -Dawt.useSystemAAFontSettings=lcd [arguments...]<\/code><\/li>System.setProperty(\"awt.useSystemAAFontSettings\",\"lcd\");<\/code><\/li>property name=\"awt.useSystemAAFontSettings\" value=\"lcd\"<\/code> (under the resources<\/code> element)<\/li><\/ul>\n\n\n\nEach of these methods naturally has it\u2019s own advantages and disadvantages. In Java web start you have a hard time controlling the environment variables or the command line but two options (the JNLP file and the source code itself) are still open to you.<\/p>\n\n\n\n
Some properties, like the anti-aliasing option, is notoriously bad by default and setting it (as shown above) will give you much better look and feel.<\/p>\n\n\n\n
The values of the awt.useSystemAAFontSettings<\/code> key are as follows:<\/p>\n\n\n\nfalse<\/code> corresponds to disabling font smoothing on the desktop.<\/li>on<\/code> corresponds to Gnome Best shapes\/Best contrast (no equivalent Windows setting).<\/li>gasp<\/code> corresponds to Windows Standard<\/code> font smoothing (no equivalent Gnome desktop setting).<\/li>lcd<\/code> corresponds to Gnome\u2019s subpixel smoothing<\/code> and Windows ClearType<\/code>.<\/li><\/ul>\n\n\n\nWhat is the best option to choose? Well \u2013 I really don\u2019t know. On my laptop lcd<\/code> looks best. Let me know about your own experience\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"There are four ways to control Java environment for runtime: _JAVA_OPTIONS environment variable. Command line when running the java virtual machine. Java source code. In this case you must make sure to set the option before it is picked up by whatever subsystem it is intended for. In Java web start you can also use … <\/p>\n