To be able to use Java compiler and JVM you need to have several environment
variables set:
- JAVA_HOME -- top directory where you unpacked
your J2SDK or JRE distribution
- PATH -- a colon separated list of directories
containing executable programs. Should contain
${JAVA_HOME}/bin directory
- CLASSPATH -- a list of directories which contain
classes, and/or a list jar files with classes.
For example, your
.profile file could have
lines like:
JAVA_HOME=/usr/local/j2sdk1.4.0
PATH=${PATH}:${JAVA_HOME}/bin
export JAVA_HOME PATH
TOMCAT_HOME=/usr/local/tomcat/jakarta-tomcat-4.0.1
export TOMCAT_HOME
CLASSPATH=myclassics.jar:${JAVA_HOME}/lib/dt.jar
CLASSPATH=${CLASSPATH}:${JAVA_HOME}/jre/lib/jce.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/common/lib/servlet.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/common/lib/activation.jar
export CLASSPATH