I have installed tomcat6 on debian 7 using
apt-get install tomcat6 tomcat6-admin. It also installed java6. The tomcat service starts up just fine and I can also restart it:
root@dd:/home/user# service tomcat6 status [ ok ] Tomcat servlet engine is running with pid 2113. root@dd:/home/user# service tomcat6 restart [ ok ] Stopping Tomcat servlet engine: tomcat6. [ ok ] Starting Tomcat servlet engine: tomcat6.
I can access the admin webpage, deploy etc.
But now I would like to specify that tomcat6 should use java5 instead. I have downloaded and extracted java5 into:
Based on this guide: http://tomcat.apache.org/tomcat-6.0-doc/RUNNING.txt I have created a file:
After I rebooted the machine I verified that the above java5 was used:
root@dd:/home/user# /usr/share/tomcat6/bin/version.sh Using CATALINA_BASE: /usr/share/tomcat6 Using CATALINA_HOME: /usr/share/tomcat6 Using CATALINA_TMPDIR: /usr/share/tomcat6/temp Using JRE_HOME: /opt/jdk1.5.0_22 Using CLASSPATH: /usr/share/tomcat6/bin/bootstrap.jar Server version: Apache Tomcat/6.0.35 Server built: Jul 18 2013 02:02:46 Server number: 22.214.171.124 OS Name: Linux OS Version: 3.2.0-4-amd64 Architecture: amd64 JVM Version: 1.5.0_22-b03 JVM Vendor: Sun Microsystems Inc.
But when I try to restart tomcat I get this error:
root@dd:/home/user# service tomcat6 restart [FAIL] Starting Tomcat servlet engine: tomcat6 failed!
The log says:
Sep 12, 2013 1:04:47 AM org.apache.catalina.core.StandardServer await SEVERE: StandardServer.await: create: java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) at java.net.ServerSocket.bind(ServerSocket.java:319)
Is this something that can simply be ignored for jdk5 or have I done something wrong? If I run
top I don't see any other tomcat6 service running and the strange thing it only happens when I change JAVA_HOME to point to jdk5.