LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where is JAVA_HOME in Linux (https://www.linuxquestions.org/questions/linux-newbie-8/where-is-java_home-in-linux-822701/)

imagine_me2 07-28-2010 02:22 PM

Where is JAVA_HOME in Linux
 
Tomcat installation requires JAVA_HOME to be defined. In Windows it is straight forward. But in Linux binaries are in one folder and libraries are in other folder.

Is there a way to find out where exactly is JAVA_HOME?

Thanks.

GrapefruiTgirl 07-28-2010 02:28 PM

Try this link here for a decent explanation: http://www.cyberciti.biz/faq/linux-u...path-variable/

And here's what I set on my system (I set this up some time ago):
Code:

sasha@reactor: which java
/usr/lib64/java/bin/java

sasha@reactor: echo $JAVA_HOME
/usr/lib64/java

The actual folder named "java" on my system, is a symlink, which points to the full-named JRE installation folder:
Code:

sasha@reactor: ls -la /usr/lib64 | grep java
drwxr-xr-x  8 root root    4096 May  8 22:27 java/
lrwxrwxrwx  1 root root        4 May 25 16:16 jre1.6.0_20 -> java/


imagine_me2 07-28-2010 03:07 PM

"which java" returns "/usr/bin/java". Now /usr/bin cannot be JAVA_HOME, or can it be?
The page you referred contains exactly the same things that you said.

Thanks for the reply.

jay73 07-28-2010 08:12 PM

Try /usr/lib/jvm.

imagine_me2 07-29-2010 02:09 AM

my /usr/lib/jvm contains many java dirs as:
java java-openjdk jre-1.6.0-openjdk
java-1.5.0-gcj-1.5.0.0 jre jre-gcj
java-1.6.0 jre-1.5.0 jre-openjdk
java-1.6.0-openjdk jre-1.5.0-gcj
java-1.6.0-openjdk-1.6.0.0 jre-1.6.0

almost all are links to other folders mostly /etc/alternatives etc. But "java-openjdk" contains the required java installation inculding binaries. Tomcat in working ok with JAVA_HOME="/usr/lib/jvm/java-openjdk"


Thanks.


All times are GMT -5. The time now is 01:56 AM.