When should each of these environment variables be used?
JAVA_TOOL_OPTIONS and _JAVA_OPTIONS are ways to specify JVM arguments as an environment variable instead of command line parameters. The are picked up by at least java and javac. They have this precedence: _JAVA_OPTIONS (overwrites the others) Command line parameters.
JAVA_TOOL_OPTIONS
is read by some JDK tools, but has limited applicability.
JAVA_OPTS
is a convention used by Apache Tomcat and some other apps, but is not read directly by any JDK tools published by Sun/Oracle, AFAIK.
From: https://forums.oracle.com/forums/thread.jspa?messageID=6438415
JAVA_OPTS is not an environment variable that the java executable will recognize on it's own. Instead, various scripts which wrap the start up of java will often use an environment variable named JAVA_OPTS to configure the java executable (for example, the tomcat startup script does this).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With