Running Tomcat on N800

I’ve been doing some N800 hacking at work recently and have been toying with getting various programming environments going. Including the one I know best: serverside Java.

To get Java on the N800, you will need jamvm. Some packages for that are provided here: http://www.internettablettalk.com/forums/showthread.php?t=2896. The packages are unsupported and not available elsewhere. Also there’s some bugs (which is why it’s not in official maemo repositories yet). The bugs mainly concern AWT and swing stuff which I don’t really care about anyway.

To install (as root):

 dpkg -i jamvm_1.4.3-1_armel.deb
 dpkg -i classpath_0.91-1_armel.deb
 dpkg -i jikes_1.22-1_armel.deb
 export PATH=/usr/local/bin:$PATH
 export CLASSPATH=/usr/local/classpath/share/classpath/glibj.zip:.

The last two commands add jamvm and jikes to the path and add the gnu classpath to the classpath.

Now you can run tomcat on the N800:

On my N800, startup time after first launch is 3-4 minutes and most of the servlet and jsp examples in the default tomcat both work correctly and the whole thing is quite responsive. The Jamvm process takes about 26MB with tomcat running. That’s all quite impressive considering that jamvm does not include a JIT.

UPDATE. I’ve continued experimenting and got the startup time down to 2 minutes now. Basically I removed all webapps except the balancer app and my own war file. Some more experimenting with jamvm and other java stuff has learned me that the main performance problem is IO while loading classes. Once that is done, the interpreter is quite fast and usable.