1827809 Members
2010 Online
109969 Solutions
New Discussion

RHEL JAVA_HOME directory

 
Richard_Anderson
Occasional Contributor

RHEL JAVA_HOME directory

Hi
how I know where is the home directory for java.

I am installing a AMS (alphaserver manager station ) software in a linux version RHEL version 4 update 3 ,

I have to edit the /etc/sysconfig/ams file and set the jave home directory , but I dont know where it is

Some command to check this ?

Thank you

Richard
2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: RHEL JAVA_HOME directory

"rpm -qa |grep java" or "rpm -qa |grep jvm" will find out the names of the installed Java packages.

Then, "rpm -ql " will list the pathnames of all files related to the named package. You can use this to find out exactly where the files related to the package are located.

On a RHEL4, any Java Virtual Machines installed from the distribution's RPM packages are located under /usr/lib/jvm.

There are lots of symbolic links in the /usr/lib/jvm directory, so that you can choose the level of specificity you want.

If you want to use the "default" Java, the correct setting would probably be
JAVA_HOME=/usr/lib/jvm/java

If you require the newest patch level of Java 1.4.2, then you could use
JAVA_HOME=/usr/lib/jvm/java-1.4.2

Using the full Java package directory name is certainly possible:
JAVA_HOME=/usr/lib/jvm/java-1.4.2-ibm-1.4.2.6
However, if you do this, you have to check your settings after each time you run up2date, as you will need to edit your path to benefit from any Java patch level updates.

If you don't need the Java development tools, you can substitute the word "jre" for "java" in the above paths: this will give you the Java Runtime Environment only.

If you installed the Java without using RPM packages (e.g. by downloading the self-extracting file from java.sun.com) the JAVA_HOME directory of that Java installation is wherever you put it. I'd strongly prefer RPM installations.
MK
Basheer_2
Trusted Contributor

Re: RHEL JAVA_HOME directory

which java

find / -name "java*" -print