Tomcat - JAVA_HOME variable

by
Jeremy Canfield |
Updated: April 01 2024
| Tomcat articles
This assume you have some flavor of Java installed on your Tomcat server. If your $CATALINA_HOME or $CATALINA_BASE directories do not contain a file named setenv.sh, create the file. In the setenv.sh file, define JAVA_HOME, like this.
export JAVA_HOME=/opt/java/jdk1.8.0_05
Or using Oracle Java.
export JAVA_HOME=/opt/oracle/jdk
Or using Adopt OpenJDK.
export JAVA_HOME=/opt/adoptopenjdk/jdk8
Restart the Tomcat JVM for this change to take effect.
The ps command can be used to ensure that the JVM is using the appropriate version of Java.
ps -ef | grep your_jvm
root3448 1 0 Oct27 ? 00:30:47 /opt/oracle/jdk/bin/java
Did you find this article helpful?
If so, consider buying me a coffee over at