Java 2 SDK for Solaris Developer's Guide

Running with Both Java 2 SDK and JDK 1.1

The /usr/java symbolic link is used to define the default Java environment on a Solaris system when more than one Java environment is installed. Currently, JDK 1.1 is installed in /usr/java1.1 and the Java 2 SDK for Solaris is installed in /usr/java1.2.

Prior to the Solaris 8 release, the /usr/java symbolic link pointed to /usr/java1.1 if both JDK 1.1 and Java 2 SDK for Solaris are installed. Starting with the Solaris 8 release, the /usr/java symbolic link points to /usr/java1.2 by default if both JDK 1.1 and Java 2 SDK for Solaris are installed.

Since there are symbolic links in /usr/bin (also known as /bin) that use /usr/java (for example, /usr/bin/java refers to /usr/java/bin/java) this /usr/java link can change the default "java" seen by most users. Many Java applications run with either Java 2 SDK for Solaris or JDK 1.1, but users and applications might wish to be selective about which "java" they use.

Java users that want to use JDK 1.1 should add /usr/java1.1/bin to their PATH settings before /usr/bin. Java users that want to use Java 2 SDK for Solaris should add /usr/java1.2/bin to their PATH settings before /usr/bin. Also, depending on the situation, you might need to make changes to other environment variables such as CLASSPATH, LD_LIBRARY_PATH, or JAVA_HOME, although none of these environment variables are required.

Java applications that require JDK 1.1 should refer to /usr/java1.1 and those that require Java 2 SDK for Solaris should refer to /usr/java1.2.

Changing the symbolic link /usr/java is not recommended. Changing the symbolic link can cause problems for Java applications that were bundled with a Solaris release prior to Solaris 8 or that are expecting to use JDK 1.1.