Friday, August 22, 2008

How-To: JDK6 on Nexenta Core Platform 2 alpha (hardy)

I finally found some time to start evaluating Java on OpenSolaris. I'd really like to see the Solaris/Java combination running some applications, so I set out to install and try it myself.

Using Ubuntu Server distributions for standard installations, I decided to take a look at Nexenta, and downloaded the Core Platform alpha ISO to drop it into a virtualized machine (VMWare 64bit host).

The install itself went well, the real problems started when I wanted to get Java running. After consulting the network for some sources, I finally found a way to get it running:

1) Download a self-extracting JDK for the Solaris platform. The easiest way to do this was the RC, because you can actuallly wget it from a basic install:


wget http://www.java.net/download/jdk6/6u10/promoted/b28/binaries/jdk-6u10-rc-bin-b28-solaris-i586-21_jul_2008.sh


Now, there are two problems that cause that you cannot install the self-extracting file:

a) if just running

./jdk-6u10-rc-bin-b28-solaris-i586-21_jul_2008.sh


you will be told that the downloaded file is corrupt.

b) if the extraction works (see step 3 for the command that will work), then you will likely get a

ld.so.1: unpack200: fatal: libCrun.so.1: open failed: No such file or directory"

when the install tries to unpack some jars using pack200.

The source for the solution is the Nexenta FAQ that actuallly points to this blog entry, that contains the solutions to the problems.

However, you will find that the blog entry doesn't work on Core Platform 2 alpha (hardy), because there is no nevada-compat package you may install. So in the next steps I'll show what I did to make it work:

2) Download and extract the missing libraries from the nevada-compat package source:


wget http://archive.nexenta.org/dists/elatte-testing/main/source/utils/nevada-compat_0.7.5.tar.gz
tar -xvzf nevada-compat_0.7.5.tar.gz
cd nevada-compat-0.7.5
bzip2 -d devpro-sunwlibc-closed-bins.tar.bz2
cd usr/lib
cp *.so.* /usr/lib


This essentially extracts the required libraries and copies them to /usr/lib where they can be found.

3) Install the JDK, but beware, you will need to use /sbin/sh:


/sbin/sh jdk-6u10-rc-bin-b28-solaris-i586-21_jul_2008.sh



Everything should work out nicely, and you should be able to run java:

jdk1.6.0_10/bin/java


Enjoy....