0

My question is very similar to this one: How to change Java version used by TOMCAT?

I'm trying to change to a different JVM for my Tomcat installation, but I'm not running Windows. I'm currently running Debian Bullseye.

On windows, there's a utility called tomcat9 that allows the user to set this (as mentioned in the other post) but Linux does not have this utility, so I'm wondering how tomcat decides which JVM to use.

Andy
  • 23
  • 6

1 Answers1

0

Apache Tomcat Requires an environment settings file (setenv.sh) in order to change any of the default settings. here's how to add one:

  1. Go to the bin directory of your Tomcat installation. In my case this was:

    /usr/share/tomcat9/bin

  2. Add the file setenv.sh to this location.

  3. Add the following line to the file:

    export JAVA_HOME=/your/jdk/version

In my case the JDK version was located in /usr/lib/jvm/java-8-openjdk-amd64

This is the only line that you need in order to make Tomcat change its JDK.

  1. Restart Tomcat. The other JDK will be used when Tomcat starts.
YourHelper
  • 703
  • 7
  • 17
Andy
  • 23
  • 6