I am using Ubuntu 14.04 and Tomcat7.
For some reason, I needed to upgrade java-7 to java-8. So I installed openjdk-8 and set it default using update-alternatives --config java
command. To my surprise, tomcat was still using java7.
To resolve the issue, I modified the /usr/share/tomcat7/bin/setenv.sh
file and added following line.
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
Now tomcat7 is using java-8 but because of above modification in setenv.sh file, I am not able to stop tomcat server using service tomcat7 stop
. It shows the [OK] message but tomcat process is still running.
Any suggestions ?
EDIT-1 : I have also noticed that service tomcat7 start
is starting the tomcat server but printing below text on console.
* Starting Tomcat servlet engine tomcat7 [fail]
EDIT-2 : I had set JAVA_HOME(which points to Java8) in setenv.sh
then service is not working but when I removed JAVA_HOME from setenv.sh
and put it in catalina.sh
then everything is working as expected.