Tuesday, October 23, 2007

Installing JDK 6 in a Nexenta Zone

In the spirit of maintaining and re-factoring this blog, the following instructions have been extracted from a previous entry related to building Eclipse and from a posting that I am currently working on related to installing tomcat with luntbuild.

Get the Sun JDK 6 download. Do NOT get the Solaris x86 packages. Instead get the self-extracting file. If you get the package installation to work, then I would love to get your instructions for this. Personally, I spent quite a bit of time on this task and pretty much had it working after installing a bunch of extra packages like sunwmfrun from the Solaris 11 install CDs and by brute-force trial and error. Eventually I stopped because the self-extracting installer is so much easier and has fulfilled my JDK needs (tomcat, the Eclipse build) so far.
I chose to install write these instructions in the context of JDK 6, but they can probably be easily extended to include JDK 5, JDK 7 or OpenJava.

These instructions are performed from inside a clean, new, base Nexenta Zone. Also see the instructions for setting up a new zone.

Step 1: Install Nexenta Dependencies

To use the self-extracting installer, you will need to make sure you have a couple of Nexenta packages. These commands can be run from a terminal.
  • root@my_zone:~# apt-get install sunwesu (if you do not have this package, you will see a checksum error when you run the executable).
  • root@my_zone:~# apt-get install nevada-compat (if you do not have this package, you will see a libCrun.so.1 error when the script runs unpack200 -- there is a posting in the Nexenta forum with more information about this error.

Step 2: Extract the JDK

Copy the JDK 6 self-extracting archive (jdk-6u2-solaris-i586.sh) to /usr/opt (I often use /usr/opt/, but you can choose whatever directory you choose).
  • root@my_zone:~# /sbin/sh (use /sbin/sh for executing the self-extracting archive or else you will see a checksum error).
  • # ./jdk-6u2-solaris-i586.sh

No comments: