Installing Java Runtime

Installing Java (from Oracle):
written by EON April 01, 2012 (Estimated Time: 10 mins)

These steps guide installing the latest version of Java runtime (version 7 update 4 at time of writing) from Oracle downloads. Adding Java opens the door to many other possibilities (Serviio, Hadoop, PS3 mediaserver ...)

Pre-requisite(s): The Binary Kit must be installed.

Let's download the 32-Bit package. We will be downloading the Solaris x86 and x64 packages. To install a later version visit Oracle. Right click on the "Solaris x86", "Solaris x64" link and copy link location. Then repeat the "wget" steps below with the respective latest i586, x64 links. Modify the -O jre "save as names" accordingly.

Update: Oracle changed the package format from a shell archive ".sh" in the previous versions (Java 6 update 31) below to ".tar.gz" format for Java 7. These steps differ only slight for the Java 7 version. Follow either the Java 7 or Java 6 steps, but not both.

Version: Java 7 update 4
cd /usr/local
wget -O jre-7u4-i586.tar.gz "http://javadl.sun.com/webapps/download/AutoDL?BundleId=63205"

Skipping the 64-Bit package is an option and will work fine. Both 32/64 are recommended, especially if you are running a EON 64-Bit ZFS server.
wget -O jre-7u4-x64.tar.gz "http://javadl.sun.com/webapps/download/AutoDL?BundleId=63208"

Let's unpack the "tar" files. Omit the x64 item for 32-Bit only.
gzip -dc jre-7u4-i586.tar.gz | tar -xvf -
gzip -dc jre-7u4-x64.tar.gz | tar -xvf -

Let's fix up the install directory name to "java".
mv jre1.7.0_04 java

Archive the installer files to a user specified location for later use.
mv jre-7u4-i586.tar.gz /user_archive_path
mv jre-7u4-x64.tar.gz /user_archive_path

Or, simply remove the install files.
rm jre-7u4-i586.tar.gz
rm jre-7u4-x64.tar.gz

Version: Java 6 update 31
cd /usr/local
wget -O jre-6u31-i586.sh "http://javadl.sun.com/webapps/download/AutoDL?BundleId=59624"

Skipping the 64-Bit package is an option and will work fine. Both 32/64 are recommended, especially if you are running a EON 64-Bit ZFS server.
wget -O jre-6u31-x64.sh "http://javadl.sun.com/webapps/download/AutoDL?BundleId=59627"

Let's run the install. Omit the x64 item for 32-Bit only.
chmod 755 jre-*
chmod 755 jre-6u31-i586.sh jre-6u31-x64.sh
./jre-6u31-i586.sh
./jre-6u31-x64.sh

Let's fix up the install directory name to "java".
mv jre-6u31 java

Archive the installer files to a user specified location for later use.
mv jre-6u31-i586.sh /user_archive_path
mv jre-6u31-x64.sh /user_archive_path

Or, simply remove the install files.
rm jre-6u31-i586.sh
rm jre-6u31-x64.sh
End: Java 6 update 31

These steps are the same independent of which version is chosen.
Create the necessary symlinks.
emp java start

Test if Java is installed and everything is working as expected.
emp java show
Java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) Server VM (build 20.6-b01, mixed mode)

Comments