Specify JRE/JDK when starting Apache Tomcat 7
24,652
Solution 1
A more flexible approach is to create a file named setenv.bat
/ setenv.sh
(pick the right one for your platform) in $CATALINA_BASE/bin
and set JAVA_HOME
there. That way it only affects Tomcat, not anything else you are running. It also makes it easy to run multiple different Tomcat installations on different JVMs.
Solution 2
Add
JAVA_HOME
variable to.bash_profile
Add
path
/classpath
entriesExport them
e.g.
JAVA_HOME=/usr/local/java
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib
export JAVA_HOME PATH CLASSPATH
Comments
-
MauroPorras almost 4 years
Is there a way to tell Tomcat 7 the path to the JVM that must be used? For example:
startup --jvm /path/to/my/jvm