Tomcat 5.5: no JDK found
November 28th, 2007
If you install Tomcat 5.5 (or 5.0) in Ubuntu, you may see Tomcat failing to start because JAVA_HOME is not set:
One way to quickly solve this problem is to edit the file /etc/default/tomcat5.5:
Find the section where the JAVA_HOME variable is defined. It should look like this:
Uncomment the line that sets the JAVA_HOME variable, and if necessary provide the java runtime environment of your preference. After editing it should look like this one:
Save the file and try again to start Tomcat, it should be able to start now:
giannis@giannis-desktop:~$ sudo /etc/init.d/tomcat5.5 start
[sudo] password for giannis:
* no JDK found - please set JAVA_HOME
giannis@giannis-desktop:~$One way to quickly solve this problem is to edit the file /etc/default/tomcat5.5:
sudo gedit /etc/default/tomcat5.5Find the section where the JAVA_HOME variable is defined. It should look like this:
# The home directory of the Java development kit (JDK). You need at least
# JDK version 1.4. If JAVA_HOME is not set, some common directories for
# the Sun JDK, various J2SE 1.4 versions, and the free runtimes
# java-gcj-compat-dev and kaffe are tried.
#JAVA_HOME=/usr/lib/jvm/java-6-sunUncomment the line that sets the JAVA_HOME variable, and if necessary provide the java runtime environment of your preference. After editing it should look like this one:
# The home directory of the Java development kit (JDK). You need at least
# JDK version 1.4. If JAVA_HOME is not set, some common directories for
# the Sun JDK, various J2SE 1.4 versions, and the free runtimes
# java-gcj-compat-dev and kaffe are tried.
JAVA_HOME=/usr/lib/jvm/java-6-sunSave the file and try again to start Tomcat, it should be able to start now:
giannis@giannis-desktop:~$ sudo /etc/init.d/tomcat5.5 start
* Starting Tomcat servlet engine tomcat5.5 [ OK ]
giannis@giannis-desktop:~$
May 3rd, 2008 at 8:27 pm no one likes a smart arse.. so many thanks for this :)
October 12th, 2008 at 10:15 am worked like britney spears, thx!
November 29th, 2010 at 5:26 pm Thank you. Good solution instead of setting it in a non-default location. Also, possible the best comments every below this...
June 16th, 2011 at 3:25 am In the Year 2011 it doesn`t work! :-(