Specify JRE / JDK when starting Apache Tomcat 7

Is there a way to tell Tomcat 7 the path to the JVM to be used? For instance:

startup --jvm /path/to/my/jvm 
+6
source share
2 answers

A more flexible approach is to create a file called setenv.bat / setenv.sh (select the correct one for your platform) in $CATALINA_BASE/bin and set JAVA_HOME there. This way it only affects Tomcat, not something else that you use. It also makes it easy to run several different Tomcat installations on different JVMs.

+28
source
  • Add the JAVA_HOME variable to .bash_profile

  • Add path / classpath entries

  • Export them

eg.

 JAVA_HOME=/usr/local/java PATH=$PATH:$JAVA_HOME/bin CLASSPATH=$CLASSPATH:$JAVA_HOME/lib export JAVA_HOME PATH CLASSPATH 
+5
source

Source: https://habr.com/ru/post/914941/


All Articles