Thursday, July 17, 2008

OpenJDK Issue in Ubuntu 8.04

Intro
Several issues with OpenJDK installed by default. Funny looking GUI, messed up fonts, resized windows, etc. One of the recent updates of 8.04 LTS was actually to install Sun Java 6. However, OpenJDK is still on the system and has precedence.

UPDATE: After Ubuntu update installs Sun Java 6 JDK and JRE, just do a complete removal of OpenJDK and all other openjdk packages.

Solution
To check which Java is default and has the priority type in the following command:
update-alternatives --display java

In my case the number for openjdk was 1061 and for Sun Java it was like 63.

The following command increases priority of the Sun Java:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-6-sun/jre/bin/java 1100

What about Java Web Start
Same applies. With similar approach check the priority:
update-alternatives --display javaws

Change the priority of Sun Java 6:
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/java-6-sun/jre/bin/javaws 1100

Should OpenJDK be removed
Not done it yet, but smells like it.

UPDATE (day after) The answer is YES. Actually, all these changing of the priorities makes sense only if you want to keep both OpenJDK and Sun Java JDK.

No comments: