Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between JAVA_OPTS and JAVA_TOOL_OPTIONS?

Tags:

When should each of these environment variables be used?

like image 780
Daniel Perez Alvarez Avatar asked Oct 14 '10 12:10

Daniel Perez Alvarez


People also ask

What is JAVA_TOOL_OPTIONS?

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.


1 Answers

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).

like image 173
Stu Btwotwo Avatar answered Sep 22 '22 04:09

Stu Btwotwo