5

Most unix commands whose operation changes based on values of environment variables have a section "ENVIRONMENT VARIABLES" in their man page. No such luck for the java binary (Sun/Oracle Java 6), though I'm fairly certain that things like CLASSPATH and perhaps JVM_OPTS have an effect.

Can anyone point me to a list of environment variables that affect the 'java' binary?

4 Answers 4

2

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

IBM's JDK has a list here: http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/topic/com.ibm.java.doc.diagnostics.50/diag/appendixes/env_var/env_jvm.html

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

Other tools like ant or tomcat may look for JVM_OPTS, and JBoss uses JAVA_OPTS.

Sign up to request clarification or add additional context in comments.

2 Comments

yep, that link is exactly what i want, except I want it for Oracle.
I think the only one that the "java" binary cares about it CLASSPATH (based on the man page). Any listing from Oracle seems to want you to use command line options.
1

Incomplete answer to my own question:

Oracle has a list for Java 8 of env variables to include when reporting a bug. Not really documentation, and no guarantee it's complete, but it is highly suggestive:

  • JAVA_HOME
  • JRE_HOME
  • JAVA_TOOL_OPTIONS
  • _JAVA_OPTIONS
  • CLASSPATH
  • JAVA_COMPILER

There is specific documentation on JAVA_HOME and JAVA_TOOL_OPTIONS

Comments

0

Setting JAVA_HOME to the installation directory and adding $JAVA_HOME/bin to the PATH sould be enough, if you don't have to configure build systems like maven or ant.

CLASSPATH is required on most start scripts to contain the location of supporting libraries (.jar) or third-party stuff.

JAVA_OPTS usualy contains parameters for setting heap-space, debug agent and things like that.

AFAIK java itself does not depend on environment settings, rather start scripts, init services and anything build around.

Thus you won't find a single list of all environment variables related to java (software-products).

3 Comments

Is JAVA_HOME actually a specified JRE envvar? As opposed to a convention application / appserver authors seem to agree on unanimously as a way of choosing the location of the JRE to use?
@Inerdial I think it is rather a convention, than a technical requirement.
This is not helpful; I am specifically asking about the java binary. I am perfectly aware that wrapper scripts may look at whatever environment variables they want to.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.