Saturday, October 29, 2011

Working Java 7 on Ubuntu Oneiric Ocelot 11.10 (update-alternatives)

I still have not figured out why the default openjdk installation on Ubuntu 11.10 seems broken. With broken I mean that there are no entries in the alternatives database and no command in the path (which follows from not being the default alternative).

As a consequence, I did the same old mumbo jumbo with update-alternatives. As the openjdk-7 is in /usr/lib/jvm/java-7-openjdk-i386/, I just run the following commands:

% sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-openjdk-i386/bin/java 4 
% sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-openjdk-i386/bin/javac 4     t
% sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-openjdk-i386/bin/jar 4 

I guess I may want to do  the trick for more executable stuff. Moreover, I have no idea whether the browser plugin works or not. It has been ages since I actually used it and right at the moment I do not care. Hope this will be helpful.

After that, just call the appropriate update-alternatives --config ja(vac|va|r) stuff!

I almost forgot... I just installed the plain openjdk-7-jdk/jdr stuff from the official ubuntu repositories.

Besides... I have seen a package sun-java-{yadda-yadda}-bin which may have been the provider of the links in the first place (when I was using sun's JDK which was correctly packaged). Right at the moment I cannot see a similar package for OpenJDK. My Ubuntu went postal recently and consequently I cannot verify. :(
Post a Comment