What is the value of JAVA_HOME for CentOS?-Collection of common programming errors

You want to set JAVA_HOME to be the root location of the JDK or JRE, for example:

export JAVA_HOME=/usr/java/jdk1.3

If the JDK (Development kit) is installed, ypu probably want it to point to that, else use the JRE path (Java Runtime Environment). Then, you might want to set your $PATH environment variable to include the bin directory as well:

export PATH=$PATH:/usr/java/jdk1.3/bin

If you are using tomcat, you might also need to set CATALINA_HOME for the tomcat user.

export CATALINA_HOME=/path/to/tomcat

To set this for the system you want to edit your /etc/profile or add a .sh file in /etc/profile.d folder. For a particular user you can put it in the users ~/.profile or ~/.bash_profile files.