Here is a stupid noob question. I installed Tomcat6 and java-6-oracle. I set the /env/environment to contain JAVA_HOME and JRE_HOME (and both point to the correct directory). However when I try and start tomcat6 it says:

no JDK found - please set JAVA_HOME

here is what my /etc/environment looks like:

JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djavax.net.ssl.trustStore=/usr/local/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat"

Where did I go wrong?

  • You also can set JAVA_HOME explicitly in catalina.sh – user1516873 Mar 22 '13 at 9:07

Add these lines to $CATALINA_HOME/bin/setenv.sh (or catalina.sh, but setenv.sh is included by it):

export JAVA_HOME="/usr/lib/jvm/java-6-oracle"
export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m Djavax.net.ssl.trustStore=/usr/local/fedora/server/truststore Djavax.net.ssl.trustStorePassword=tomcat"

export makes the variable available to child processes.


There is mainly the classpath issue in tomcat. There are many ways to solve it. One of the ways is as follows.

1) Locate the installed java. IT is present in /usr/lib/jvm/

2) After installing tomcat open its configuration

sudo vi /etc/default/tomcat7

3) Search for #JAVA_HOME Uncomment it and set the proper path Example JAVA_HOME=/usr/lib/jvm/java-7-oracle

4) Save the file and restart tomcat


By default Tomcat will run preferably with OpenJDK JVMs, then try the Sun JVMs, then try some other JVMs. You can force Tomcat to use a specific JVM by setting JAVA_HOME in /etc/default/tomcat6


It seems that when you start tomcat6, /etc/environment is not read.

In your tomcat6 start script, try to add this:

[ -r /etc/environment ] && . /etc/environment
  • I put that in the startup.sh script but it didn't work. Any other ideas? – user5013 Mar 22 '13 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.