Wednesday, April 4, 2012

Sun Java on Linux ..


Step 1: Check which java is being used by the system:
[root@localhost ~]# which java
/usr/bin/java

Step 2: Most of the time it provides a sys link:
[root@localhost ~]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Mar 12 21:01 /usr/bin/java -> /etc/alternatives/java ***
[root@localhost ~]# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 35 Mar 12 21:01 /etc/alternatives/java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
[root@localhost ~]#

Step 4: Remove that sys link called 'java'

Step 5: Create a fresh syslink with your freshly installed java as

ln -s /usr/java/jre1.6.0_31/bin/java java

Now check:


[root@localhost bin]# java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

No comments:

Post a Comment