What environment variables affect java binary?

Most unix commands whose operations vary based on the values ​​of the environment variables have the ENVIRONMENT section on their manual page. There is no such luck for Java binary (Sun / Oracle Java 6), although I'm sure things like CLASSPATH and possibly JVM_OPTS have an effect.

Can someone tell me a list of environment variables that affect the java binary?

+4
source share
3 answers

I don’t think there are many, but it will depend on which implementation (oracle vs ibm).

There is a list in the IBM JDK: http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/topic/com.ibm.java.doc.diagnostics.50/diag/appendixes/env_var/env_jvm.html

The JDK oracle has at least CLASSPATH , JAVA_HOME and JRE_HOME . Although on the man page for "java" the only environment variable that he mentions is CLASSPATH.

Other tools, such as ant or tomcat, can search for JVM_OPTS , and JBoss uses JAVA_OPTS .

+2
source

Installing JAVA_HOME in the installation directory and adding $JAVA_HOME/bin to PATH will suffice if you do not need to configure build systems such as maven or ant.

CLASSPATH is required for most startup scripts to contain the location of supporting libraries (.jar) or third-party materials.

JAVA_OPTS usually contains parameters for setting heap space, debug agent, etc.

AFAIK java itself does not depend on the environment settings; rather, it runs scripts, init services and all around.

Thus, you will not find a single list of all environment variables associated with java (software products).

0
source

There is also _JAVA_OPTIONS , mentioned here , that works for all JVM calls, including applets and Webstart.

0
source

Source: https://habr.com/ru/post/1382759/


All Articles