Set default value for java property (system wide)Tag(s): Environment


If you find yourself using the same options over and over before laucing a java process, you can set up a special environment variable to contain your default options and the JVM will pick up the the values.

If the Java process is launch via java.exe then the environment variable is called _JAVA_OPTIONS,

e.g. In Windows:

set _JAVA_OPTIONS=-Xms64m -Xmx128m -Dawt.useSystemAAFontSettings=lcd
In Linux:
export _JAVA_OPTIONS='-Xms64m -Xmx128m -Dawt.useSystemAAFontSettings=lcd'
ref : http://java.sun.com/j2se/1.5.0/docs/guide/2d/flags.html

If the Java process is launch via javaw.exe (Applet) then the environment variable is called _JPI_VM_OPTIONS.

For example :

_JPI_VM_OPTIONS = -Dsome.property=true

For a Java Web Start process (javaws.exe), the environment variable is called JAVAWS_VM_ARGS.

For example :

JAVAWS_VM_ARGS = -Dsome.property=true
ref : http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/plugin.html#gcexdd
blog comments powered by Disqus