Running Java on an #N900

One of the first questions I came up against when I started working with the Nokia N900 was, “Can it run Java?” According to the Java page on the Maemo Wiki, the answer was, “It’s not supported, but here are a few things you can try.” So, I poked around and made a little progress.

I figured the best starting point would be Sun (Now Oracle)’s Java, so I went to their Java SE for Embedded Downloads. There, I went through the steps to download ARMv6 Linux - Headful (Early Access), EABI, glibc 2.5, Hard Float (VFP), Little Endian. I figured I would start with a headful installation, and if that failed, try the headless install.

The process of getting the Early Access was a bit cumbersome. You needed to fill out a form with about a dozen required fields and dozens more optional fields. I don’t remember if I ended up filling out all the optional fields, or simply got bored part way through and only filled out some of them. Once I filled out the form, I received an email from Sun with a special location where I could download a ninety day free trial.

After decompressing and extracting files the compressed tarfile that I downloaded onto the N900, I ended up with a directory ejre1.6.0_10 which I put in my /home/user directory. I didn’t want to put it anywhere that would take up valuable rootfs space and wanted to be able to easily remove it when the time came. Uncompressed, it took up about 45 meg.

I then created a simple Hello World java application. I created it on different Linux box and compiled it there. I then copied over the .class file and it ran fine at the command prompt on the N900. I search around through the files, but could not find a plugin for any of the browsers, so I set the project aside.

Later, I did find “ejre1.6.0_10/lib/arm/libnpjp2.so” which I believe is the plugin I need, but by then, My trial from Sun has expired.

Recently, others have been asking about Java on the N900, so I thought I would revisit it. Since my trial from Sun has expired, I thought I would try the OpenJDK approach. The first pass of this went incredibly easy. I went to the Cambridge Software Labs’ OpenJDK Binary and Source Release page and downloaded the runtime.

Running the java program from the installed directory worked nicely. There is also a pluginappletviewer, but that seems to rely on ‘IcedTea’ which I have not been able to find for the N900 yet.

So now I have the ability to run Java applications from the command line with a version that is not scheduled to stop working in three months. I still don’t have applets running, but I’ll revisit this again when I get the urge. Scanning through the JAVA on the N900 is possible! thread and talk.maemo.org, it looks like I’ve gotten about as far as others have. I’ll keep trying things and checking the talk thread. Hopefully someone will have an interesting break through one of these days. Meanwhile, there is the question of what sort of support MeeGo will have for Java.

Many people point out that Maemo, Moblin and Meego all have rich development environments, so Java isn’t really needed, but I think this is short sighted. There are a lot of great projects already built in Java and deployed to the web that it would be great to be able to access from a Maemo, Moblin or Meego device. Someday, someone will manage to get it to work.

(Categories: )