Tuesday, February 14, 2012

Setting up 64-bit Java6 u29 on Solaris10


To install a higher version of Java on your system, you first need to uninstall the previous version. If it is a 64-bit version then uninstall the 64-bit first and then 32-bit. While installing you have to follow the reverse order, first 32-bit and then the 64-bit.

Both 64-bit and 32-bit Java are available here.
You will find that Java is available in two formats, .z and .sh. The one with sh extension is a self extracting binary file whereas the one with the .z extension contains the Solaris packages. We will go with the Solaris packages with .z extension.

You can find your Java version with the help of below mentioned command.
# java -version

Unintallation
We will first uninstall the 64-bit Java that is installed in the system. Type the below command to remove the previously installed 64-bit Java.
# pkgrm SUNWj6rtx SUNWj6dvx SUNWj6dmx

Now we can go ahead and remove the 32-bit.
# pkgrm SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo

If you have already downloaded the .z file for both 32-bit and 64-bit, run gunzip and tar to extract both of them it to some folder. You can extract both 32-bit and 64-bit packages in the same directory. Finally from that folder (place where you had extracted the package) run the below command to install the packages.
# pkgadd -d . SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo
Needless to say that you have to type yes for every package to get installed.

Similarly, we can install the 64-bit package using the below command.
# pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx

The new version of Java is installed. By default Java is installed in /usr/jdk/1.6.0_<update> directory. To set the PATH permanently for all users without rebooting the system, we have to declare PATH in /etc/profile followed by export PATH. Below is the sample screenshot of /etc/profile on my system.


No comments:

Post a Comment