I am trying to upgrade my java version on solaris sparc machine. I have installed the o/s software from scratch and it came with some default java version. I want to install the newer version of java available on top of this machine.
I have already installed the latest version in my home directory (i.e)
jdk-6u26-solaris-sparcv9.sh jdk1.6.0_26
But still it is pointing to the old version. Can you please help me in creating symbolic links to point to the newer version.
Current java version as below:
java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
which java
/bin/java
ls -la /bin/java
lrwxrwxrwx 1 root other 16 Aug 19 19:53 /bin/java -> ../java/bin/java
cd /usr/jdk
>ls -la
total 16
drwxr-xr-x 4 root bin 512 Sep 14 15:33 .
drwxr-xr-x 46 root sys 1024 Sep 14 15:35 ..
lrwxrwxrwx 1 root root 27 Sep 14 15:32 entsys-j2se -> /usr/jdk/instances/jdk1.5.0
drwxr-xr-x 3 root bin 512 Aug 19 19:52 instances
lrwxrwxrwx 1 root other 7 Aug 19 19:56 j2sdk1.4.2_22 -> ../j2se
lrwxrwxrwx 1 root other 18 Sep 14 15:33 jdk1.5.0_04 -> instances/jdk1.5.0
lrwxrwxrwx 1 root other 11 Sep 14 15:33 latest -> jdk1.5.0_04
drwxr-xr-x 8 root bin 512 Aug 19 20:15 packages
Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute:
% java -version
This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.
To find out which java executable the first one found in your PATH, execute:
% which java
Below are the steps to set the PATH permanently,
Note: We are here giving instructions for two most popular Shells on Linux and Solaris.
Please visit link below if you are using any other shells.
Path Setting Tutorial
For bash Shell:
Edit the startup file \(~/ .bashrc\)
Modify PATH variable:
PATH=/usr/local/jdk1.6.0/bin
export PATH
Save and close the file
Open new Terminal window
Verify the PATH is set properly
% java -version
For C Shell (csh):
Edit startup file \(~/ .cshrc\)
Set Path
set path=\(/usr/local/jdk1.6.0/bin \)
Save and Close the file
Open new Terminal window
Verify the PATH is set properly