Setting Tomcat Environment Variables on Windows+Unix

October 6th, 2009No Comments

This section provides informaton about how to setup different environment variables for tomcat

* In a shell or DOS window, change to the "jakarta-tomcat-" directory.

* Set the environment variable JAVA_HOME to point to the root directory of your JDK hierarchy. You may optionally add the Java interpreter to your PATH environment variable. The exact directory may vary from system to system. Check your local file system to be sure where Java is installed.

1. Win32:

set JAVA_HOME=c:\"top level directory of your java install"
set CATALINA_HOME=C:\"top level directory of your Tomcat install"
set PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin

2. Unix (bash/sh):

JAVA_HOME=/usr/local/java/jdk1.3.1; export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH; export PATH

3. Unix (tcsh):

setenv JAVA_HOME=/usr/local/java/jdk1.3.1
setenv PATH $JAVA_HOME/bin:$PATH

* You may optionally set the TOMCAT_HOME environment variable. If the supplied shell/batch scripts are executed from "jakarta-tomcat-" or from its "bin" subdirectory, then they will successfully set TOMCAT_HOME for you if not already set. If you wish to execute these shell/batch scripts from other directories, you must set TOMCAT_HOME explicitly.

1. On Win32 systems you should type:

set TOMCAT_HOME=c:\jakarta-tomcat-

2. On UNIX (using bash/sh) you should type:

TOMCAT_HOME=/usr/local/jakarta-tomcat- ; export TOMCAT_HOME

3. On UNIX (using tcsh) you should type:

setenv TOMCAT_HOME /usr/local/jakarta-tomcat-

* You can also do the same thing on Windows by following below steps

1. Go to system properties.
2. Go to environment variables and add a new variable with the name JAVA_HOME and provide variable value as C:\"top level directory of your java install".
3. Go to environment variables and add a new variable with the name CATALINA_HOME and provide variable value as C:\"top level directory of your Tomcat install".
4. In path variable add a new variable value as ;%CATALINA_HOME%\bin;

For more infomation click here

Related Posts:

Tagged : , , ,

Comments are closed.