HOWTO Install a JRE on Sun Solaris

This article was first written in September 2004 for the BeezNest technical
website (http://glasnost.beeznest.org/articles/174).
It may seem natural that Java should be available on Solaris. Actually, it is, but Solaris 8 for example features an obsolete JRE (Java Runtime Environment), JRE 1.2. Let us see how to install a r(d)ecent JRE on Solaris. Download the JRE for Solaris, and for your architecture. You'll get a file like this: j2re-1_4_2_05-solaris-sparc.sh. Go to /usr as root. Execute the following command, given the name hereup:
# sh j2re-1_4_2_05-solaris-sparc.sh
Replace the link /usr/java (which currently points to ./java1.2) with a link to the newly-created directory.
# ln -s ./j2re1.4.2_05 java
You're done! To test you are using the new version, just issue a:
# java -version
You should now see something like this:
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)