Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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"

Where did I go wrong?

share|improve this question
You also can set JAVA_HOME explicitly in – user1516873 Mar 22 '13 at 9:07
up vote 0 down vote accepted

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

export JAVA_HOME="/usr/lib/jvm/java-6-oracle"
export JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m"

export makes the variable available to child processes.

share|improve this answer

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

share|improve this answer

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

share|improve this answer

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
share|improve this answer
I put that in the script but it didn't work. Any other ideas? – user5013 Mar 22 '13 at 14:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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