Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed tomcat7 (using apt-get install) and whenever I want to start tomcat7 it says :

* no JDK found - please set JAVA_HOME

I have set JAVA_HOME in my bash.bashrc and also in ~/.bashrc and when I issue echo $JAVA_HOME I clearly see that this variable is pointing to my jdk's root folder. Can someone help me with this please?

Thanks

share|improve this question
1  
This helped me to find where I can tell tomcat7 what JDK to use. –  icedwater Jul 23 '13 at 4:00
    
Same here. Now I know where tomcat looks for JAVA_HOME. –  slayedbylucifer Oct 28 '13 at 5:40

3 Answers 3

up vote 25 down vote accepted

You can try this:

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

gksudo gedit /etc/default/tomcat7

When the file opens, uncomment the line that sets the JAVA_HOME variable.

enter image description here

Save and restart tomcat7 server.

share|improve this answer

Hit Ctrl+Alt+T to open terminal and run:

sudo gedit /etc/default/tomcat7

Find commented JAVA_HOME, uncomment and change the directory to your JDK environment. No need to restart, and then it's done!

share|improve this answer

Just add following line in /etc/default/tomcat7 at where JAVA_HOME variable is defined

JAVA_HOME=/usr/lib/jvm/java-7-oracle

then run command

sudo service tomcat7 restart
share|improve this answer

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.