Wednesday, September 07, 2011

Java development using Ubuntu 11.10 and OpenJDK 7


I tried Ubuntu 11.10 Oneiric Ocelot Beta 1. LightDM is lighter and beautiful. Maybe I can keep using Ubuntu on my ThinkPad T42, rather than jumping onto Lubuntu.

Due to the retiring of the "Operating System Distributor License for Java (DLJ)", Sun / Oracle JDKs / JREs cannot be installed by enabling Canonical Partners' repository any more. It's a good news to OpenJDK. With more usage of OpenJDK, we can expect higher priority and fewer bugs.

Since Java 7 is out, the first thing I did is installing OpenJDK 7. From Ubuntu Software Centre, you can only install JRE. I miss Synaptic Package Manager.
sudo apt-get install openjdk-7-jdk

Change default JRE of system from OpenJDK 6 to 7.
sudo update-alternatives --config java

I got following error when installing Subclipse plugin to Eclipse.
An internal error occurred during: "Install download0".
Library /usr/lib/i386-linux-gnu/libsoftokn3.so does not exist

Creating a symbolic link sovled it.
cd /usr/lib/i386-linux-gnu/
sudo ln -s nss/libsoftokn3.so libsoftokn3.so

After Subclipse is installed, I had a small problem in starting Eclipse 3.7 Indigo, but it's a common one.

sudo apt-get install libsvn-java
and
-Djava.library.path=/usr/lib/jni
in eclipse.ini solved it.

m2eclipse and Google plugin for Eclipse work out of box. Maven 3.0.3 works fine with OpenJDK 7.

Apache Tomcat 7.0.21 works fine with OpenJDK 1.7.0 but if you haven't created the above symbolic link, you'll get below error when starting Tomcat.
java.security.ProviderException: Library /usr/lib/i386-linux-gnu/libsoftokn3.so does not exist
at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:292)
at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:103)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

I also tried to install Gnome Shell.
sudo apt-get purge gnome-shell

Installation finished successfully but later when I specified Gnome to login, I got a dialog box saying
failed to load session "gnome"

There are a couple of solutions to the problem but none works for me, so I installed classic Gnome.
sudo apt-get install gnome-session-fallback

A fantastic experience, I'm looking forward to its release next month.

No comments:

Post a Comment