logIt Log Around The Clock

Hello World with JamVM Embedded JVM on Ubuntu ARM

While waiting for my BeagleBoard xM shipment, I was considering Java as one of the possible application platforms. Anyhow, the keyword “embedded Java ARM” landed me to the tiny JamVm. This JVM is said to be working with ARM Cortex A8 which can be emulated under QEMU running Ubuntu ARM. The fact that there had been already a Karmic image that work with QEMU would shorten the time.

A “Hello World” class to test the JVM will be:

class HelloWorldJamVM {
	public static void main(String[] args) {
		System.out.println("hello world");
	}
}

saved as HelloWorldJamVM.java. However, executing a “Hello World” requires longer steps than writing that class.

In order for the JamVM 1.5.4 to run on Ubuntu, we need (1) build-essential (certainly so) and (2) GCJ with dependency of (3) zlib1g-dev. It’s all available in the Karmic ARM repo. Another thing that we need is GNU Classpath 0.98.

Following the instruction, as root we can then configure, make, make install, make install-strip sources under jamvm-1.5.4 directory. Continue them with the classpath-0.98 sources by configuring as follow

./configure --disable-gtk-peer --disable-gconf-peer --disable-plugin --disable-Werror

and then make install as usual. The whole compiling will run slow for sure as QEMU emulates ARM far from nearing native processor performance in my case.

We can compile the above “Hello World” using GCJ with the command javac, which is actually linked to /usr/bin/gcj-wrapper-4.4.

javac HelloWorldJamVM.java

A HelloWorldJamVM.class bytecode file will appear and we can run this with JamVM

PATH=$PATH:/usr/local/jamvm/bin 
export PATH
jamvm HelloWorldJamVM
qemu-ubuntu-arm-cortex-a8-running-jamvm-embedded-jvm.jpg

QEMU with Ubuntu ARM Cortex A8 running JamVM embedded JVM


Leave a Reply