Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAVA_HOME : where is java installed

Tags:

java

tomcat

I'm trying to set the JAVA_HOME to get tomcat 7 to work with no success.

I'm using CentOS 6.3. Here is what I did so far:

which java /usr/bin/java

so I edited the .bash_profile, I added

export JAVA_HOME=/usr/bin/java

didn't work. I searched online and found another user on stackoverflow who found it in /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/java

I searched on my computer and found that java is located in /usr/lib/jvm/jre-1.6.0-openjdk/bin

I then changed the JAVA_HOME to export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk/bin , tried to start tomcat but server can't be found.

How do I find where java was installed? I didn't install it myself; it was installed during linux installation.

Thanks in advance, Mike

like image 617
WhatIf Avatar asked Dec 11 '22 19:12

WhatIf


1 Answers

export JAVA_HOME=/usr should do it. The script runs $JAVA_HOME/bin/java

like image 109
Diego Basch Avatar answered Dec 29 '22 20:12

Diego Basch