Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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_HOME="/usr/lib/jvm/java-6-oracle"
JRE_HOME="/usr/lib/jvm/java-6-oracle/jre"
FEDORA_HOME="/var/lib/fedora"
CATALINA_HOME="/var/lib/tomcat6"
JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djavax.net.ssl.trustStore=/usr/local/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-oracle:/usr/lib/jvm/java-6-oracle/bin:/usr/lib/jvm/java-6-oracle/jre:/var/lib/fedora/server/bin:/var/lib/fedora/client/bin"

Where did I go wrong?

share|improve this question
    
You also can set JAVA_HOME explicitly in catalina.sh –  user1516873 Mar 22 '13 at 9:07

3 Answers 3

up vote 0 down vote accepted

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.

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 startup.sh script but it didn't work. Any other ideas? –  user5013 Mar 22 '13 at 14:32

Your Answer

 
discard

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.