solarisopensolaris

Installing jdk1.6 on opensolaris


I installed opensolaris I saw that it has /usr/jdk/jdk1.6 however it had no bin/javac only java

my default java -version is jdk1.6 just after opensolaris installation however as I have no javac I downloaded jdk1.6 for solaris and after executing the jdk1.6xx.sh i did cd to the folder of jdk and then inside bin directory I ran javac however its giving me NoClassDefFoundError java/lang/Object. (same thing happened to me on a regular solaris installation). anyone can tell me how am i supposed to have a working jdk1.6 with javac on opensolaris? Thanks


Solution

  • OpenSolaris includes just the Java Runtime (JRE) out of the box - developer tools like compilers for C, C++, & Java don't fit on the LiveCD so are installed from the package repository.

    pkg search javac will show the packages available with the javac command - if you're using the latest development builds, it will be in the “developer/java/jdk” package, or “jdk” for short, so you could install with pfexec pkg install jdk. On older builds, like the 2009.06 stable release, the package name will be something like “SUNWjdk” instead.