I am having some issues with Java (OpenJDK Java 7 Runtime) on Ubuntu 12.04, and just want to make sure I have my CLASSPATH and JAVA_HOME variables set correctly.
CLASSPATH=".:/usr/local/sbin:/home/king/Documents/bin/java/jar/*:/home/king/Documents/bin/java/jar/log4j.xml:/opt/fop/build/fop.jar"
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386/bin"
Is my JAVA_HOME varibale set right here? I am wondering if it should be set to
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386/jre"
instead?
My main issue I am having is with log4j
log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry).
log4j:WARN Please initialize the log4j system properly.
I have the file "log4j.xml" in a location on the classpath, so I am confused about the problem.
JAVA_HOME
norCLASSPATH
are "required" to run Java apps. By convention, shell scripts invoking Java apps may useJAVA_HOME
to point to one JVM when there's more than one installed, or it's installed in a non-standard directory not in the PATH. If not programming (ie: using multiple JVM's + mvn/ant etc), don't set it; just use (g)alternatives to put Java in your default PATH. If you do set JAVA_HOME, the executable is always$JAVA_HOME/bin/java
. The var CLASSPATH is used by the JVM, but don't set it (very error-prone). Instead use the cmd line options for javac/java/ant/mvn. – michael Sep 29 '12 at 08:38java -cp dir1:dir2/foo.jar:dir3
). (Note: depending on the tool, the cmd line option might be-classpath
or just-cp
). – michael Sep 29 '12 at 08:46