TLS offloading
Apache Tomcat

Configuring environment variables for Apache Tomcat

1min

Apache Tomcat relies on several environment variables to function correctly. Select one of the following operating systems to set the required environment variables:

Linux
Windows
1

Determine the installation path of Oracle Java:

Find the path where Oracle Java is installed, such as /usr/lib/jvm/. Use the following command to list the installed JDKs:

Shell


For example, if you installed Oracle Java 11, the path is likely: /usr/lib/jvm/jdk-11-oracle-x64.

2

Determine the installation path of Tomcat:

You can use the find command to locate the Tomcat installation directory:

Shell


catalina.sh is stored in the bin directory of the Tomcat installation. The directory containing catalina.sh is the CATALINA_HOME.

3

Edit the profile file:

Open a terminal and use a text editor to edit the /etc/profile file, which the system uses when users log in. You might need superuser privileges to edit this file.

Shell

4

Add the environment variables and update PATH:

Add the following lines to the end of the /etc/profile file, replacing the path with the actual path to your Oracle Java installation:

Text

5

Apply the changes:

After saving the file, apply the changes by sourcing the profile file:

Shell

6

Verify the configuration:

To ensure that the environment variables are set correctly and the PATH is updated, check their values with the following commands:

Shell


You should see the individual paths set for JAVA_HOME and CATALINA_HOME, as well as their inclusion in the PATH.