Monday, November 22, 2010

Upgrading from Java version 1.4.2 to 1.6.0 on RedHat Linux

I was planning on running vdbench to get some performance numbers for the IBM Storwize V7000. I installed vdbench, and then decided to bring up it's GUI with the ./vdbench -gui command, that is when it told me that the Java version on my RedHat Linux machine was1.4 , and that I need to update it to 1.5 or a later version.

I downloaded Java from http://www.java.com/en/download/help/5000011400.xml  and installed 1.6 under /usr/java

The current java on my RedHat host machine was linked to:
[root@isvx3 bin]# ls -l /usr/bin/javalrwxrwxrwx 1 root root 22 Nov 22 12:42 /usr/bin/java -> /etc/alternatives/java
[root@isvx3 java]#java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@isvx3 java]#




I removed that link:
[root@isvx3 bin]# rm /usr/bin/java
rm: remove symbolic link `/usr/bin/java'? y


Re-linked the jre1.6 which I had installed under /usr/java:
[root@isvx3 bin]# ln -s /usr/java/jre1.6.0_22/bin/java /usr/bin/java
[root@isvx3 bin]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 30 Nov 22 13:01 /usr/bin/java -> /usr/java/jre1.6.0_22/bin/java




Check to see if the Java version has been updated:
[root@isvx3 bin]# which java
/usr/bin/java
[root@isvx3 bin]# java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
[root@isvx3 bin]#

6 comments:

Unknown said...
This comment has been removed by the author.
Unknown said...

this is best post i have ever seen

thanks a lot, but so much

i really tired trying to remove and update to a newer version on Linux,

thanks alot again

Mayur said...

Manee, thanks for leaving a comment. I'm glad it helped.

Khalid Oracle Blog said...

Great Article, Really useful.

Khalid Oracle Blog said...

Great Article, Really useful.

Mayur said...

Thank you Khalid.