0

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

Jas
  • 14,493
  • 27
  • 97
  • 148

3 Answers3

1

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.

alanc
  • 4,102
  • 21
  • 24
  • pkg search javac gives me stuff like this: basename link usr/bin/javac pkg:/SUNWj6dev@0.5.11-0.91 – Jas Oct 01 '10 at 10:36
  • when trying to install with pkg intall jdk or SUNWjdk it says that it cannot find them try relatxing the pattern, also when I did pkg search javac it wrote: basename link usr/bin/javac pkg:/SUNWj6dev@0.5.11-0.91 however when I went to the base directories where I have extracted the jdk1.6 tar.Z and tried to do pkgadd -d . SUNWj6dvx WUNWj6dmx SNWj6rtx then its saying Installation of SUNWj6dvx was successful however javac results with no such command again, can you help please? – Jas Oct 01 '10 at 10:42
  • Since pkg search identified SUNWj6dev as the package name, the command would be `pkg install SUNWj6dev` (the *pkg:/* is optional). Also 0.91 is a very very old developer build (it was part way between the 2008.05 and 2008.11 stable releases) - seems strange to be using if you just installed it. – alanc Oct 01 '10 at 18:13
  • hi is there a way for me to just update my opensolaris or just download a more newer version (I downloaded opensolaris from its website...) so that when I do pkg search javac and then pfexec pkg install jdk it will just work as you suggested? (I can "reformat my computer' and install whatever you suggest! – Jas Oct 01 '10 at 19:24
  • `pkg image-update` should upgrade you to a newer version - there's lots of details on http://opensolaris.org/ – alanc Oct 02 '10 at 21:23
0

What is the value of your JAVA_HOME environment variable? And did you remember to append that to your PATH?

TMN
  • 3,060
  • 21
  • 23
  • i'm not sure because you see I don't have the jdk installed so i have got no javac so i don't know where and if i have somewhere to point my JAVA_HOME to... – Jas Oct 01 '10 at 17:09
0

Install JDK on OpenSolaris (or OpenIndiana) is quite simple, you need to use

$ pfexec pkg install jdk
$ pfexec pkg install jdk64

I've a post (in Spanish) with all the process,

http://sparcki.blogspot.com/2010/05/instalar-java-jdk-en-opensolaris.html

Urko,

itilys
  • 186
  • 4