December 21, 2006

Installing java in SOLARIS UNIX

Installation of Solaris Packages

Download j2sdk-1_4_2_-solaris-sparc.tar.Z and check the file size to ensure that you have downloaded the full, uncorrupted software bundle.

SPARC processors: zcat j2sdk-1_4_2_-solaris-sparc.tar.Z | tar -xf –
On x86 processors: zcat j2sdk-1_4_2_-solaris-i586.tar.Z | tar -xf –

Become root by running su and entering the super-user password su – root

pkgadd -d SUNWj3rt SUNWj3cfg SUNWj3dev SUNWj3man SUNWj3dmo

Delete the tar files and extracted SUNW* directories.
Exit the root shell.

Uninstallation :

If you have previously installed the Solaris packages for Java 2 SDK 1.3.0, 1.3.1, 1.4.0, or 1.4.1, remove them by running:

pkgrm SUNWj3dmo SUNWj3man SUNWj3dev SUNWj3rt

If you have previously installed packages SUNWlj3dv and SUNWlj3rt for localization support in Java 2 SDK 1.3.0, you should also remove them:

pkgrm SUNWlj3dv SUNWlj3rt

If you have previously installed the Japanese man page packages for Java 2 SDK 1.3.0 or 1.3.1, remove them also:

pkgrm SUNWjej3m SUNWjpj3m SUNWjuj3m

Location of libjvm.so files

If you use the Invocation API to launch an application directly rather than using the Java application launcher, be sure to use the correct paths to invoke the Java HotSpot client virtual machine or the Java HotSpot server virtual machine as desired.

The path within the SDK to the client virtual machine is:

$JAVA_HOME
/jre/lib/sparc/client/libjvm.so (on SPARC processors)
$JAVA_HOME
/jre/lib/i386/client/libjvm.so (on x86 processors)

The path to the server virtual machine is:

$JAVA_HOME
/jre/lib/sparc/server/libjvm.so (on SPARC processors)
$JAVA_HOME
/jre/lib/i386/server/libjvm.so (on x86 processors)

The Exact VM and Classic VM are no longer part of the software platform, and legacy code that uses the Invocation API to launch an application based on old paths to the Exact or Classic virtual machines will not work.

Getting error with libjvm.so: cannot open shared object file: No such file or directory in UNIX
It is an issue with the LD_LIBRARY_PATH; however this links to the correct location of libjvm.so

$: find / -name libjvm.so
$: export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME jre/lib/i386/client:$ LD_LIBRARY_PATH

No comments: