Redhat 5.5 and java -version
Hi All,
I am working on a new Redhat Server (RHEL 5.5). It has java version "1.4.2" installed on it. I have installed jre1.6.0_24 on it but "java -version" is still showing the old java version (1.4.2). How can point "java -version" to the new install? Thanks for your help! Ajay |
Quote:
Code:
you can either create a symlink from your new jreinstall path executable to your standard java path (/usr/bin/java, but you would have to rename /usr/bin/java first) OR add the path for the new jre to /etc/profile or your .bash_profile etc or just switch the paths from the old java to the new jre install. |
The important question here is - "Is anything going to break, if i tell you how, because some program will need that old java version?"
|
Hi,
When you run java -version, the system searches for the PATH for the installed java. So update the path, IMO it should work : #export PATH=/new/path of java/wherever/it/is:$PATH Now try # java -version. |
Thanks for your responses. I was able to do this, here is the solution:
# java -version java version "1.4.2" gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48) # which java /usr/bin/java # ls -ld /usr/bin/java lrwxrwxrwx 1 root root 22 Jan 11 04:55 /usr/bin/java -> /etc/alternatives/java # rm /usr/bin/java rm: remove symbolic link `/usr/bin/java'? y # ln -s /usr/java/jre1.6.0_24/bin/java /usr/bin/java # ls -ld /usr/bin/java lrwxrwxrwx 1 root root 30 Mar 8 10:20 /usr/bin/java -> /usr/java/jre1.6.0_24/bin/java # java -version java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode) |
cool.
|
yayyy
|
Keep in mind that a LOT of java programs like you to:
export JAVA_HOME=/wherever/java/bin/ In your shell environment |
The standard set up for EL5 is :
1) # /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.6.0_24/bin/java 2 2) # /usr/sbin/alternatives --config java . |
All times are GMT -5. The time now is 02:20 AM. |