1

I have the Java JDK 1.7.0_21 installed on my Debian machine (along with others). I have configured Debain to use this JDK:

pi@raspberrypi ~ $ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode)

From reading the notes in Tomcat catalina.sh, I understand that the Tomcat server should use the JAVA_HOME/JRE_HOME system variables

#   JAVA_HOME       Must point at your Java Development Kit installation.
#                   Required to run the with the "debug" argument.
#
#   JRE_HOME        Must point at your Java Development Kit installation.
#                   Defaults to JAVA_HOME if empty.

I have set those to the proper directory. Echoing the variables gives the following output:

pi@raspberrypi ~ $ echo $JAVA_HOME
/opt/Oracle_Java/jdk1.7.0_21/bin
pi@raspberrypi ~ $ echo $JRE_HOME
/opt/Oracle_Java/jdk1.7.0_21/jre

The Tomcat Web Application Manager however still shows 1.6.0_27-b27 as the JVM in use.

Do you have any advice on how to make Tomcat run with the 1.7.0_21 JDK?

mritz_p
  • 3,008
  • 3
  • 28
  • 40
  • 1
    Did you install Tomcat using the .deb package or did you download Tomcat from tomcat.apache.org? – Martin Aug 27 '13 at 13:02
  • I have installed it through apt-get. Looking closer it seems as if I run Tomcat 6 which doesn't seem to be compatible to Java 1.7 (http://stackoverflow.com/questions/9592791/tomcat6-and-java-7). So I'm going to look into that first. Thank you! – mritz_p Aug 27 '13 at 14:33

1 Answers1

1

Navigate to the directory where Tomcat is installed, and go into the \bin folder (/tomcat/bin). Right-click the file catalina.bat, and then select Edit

Scroll down in the code until you pass the end of the beginning “rem” comments, and insert the following code pointing to your JDK’s root directory:

     set JAVA_HOME=/opt/Oracle_Java/jdk1.7.0_21

Save your changes, and restart Tomcat.

Prabhakaran Ramaswamy
  • 25,706
  • 10
  • 57
  • 64