Search This Blog

24 June 2009

Maxine on OpenSolaris

Maxine is a VM designed for and written in the Java(TM) Programming Language with an emphasis on leveraging meta-circularity, componentized design, and code reuse to achieve flexibility, configurability, and productivity for academic and industrial virtual machine researchers.
So I thought I'd give it a shot.

I extracted the zip file into into /opt.  Originally permissions were as root:root (due to pfexec usage for opt) but I had to change it since maxine didn't like not having write access to the directory.  I also created a symlink to /opt/maxine [which will be how I refer to it from now on].

I copied junit-4.4.jar into /opt/maxine/bin and added a line at the top of /opt/maxine/bin/max:

JUNIT4_CP=/opt/maxine/bin/junit-4.4.jar
I modified my .zshrc to set /opt/maxine as MAXINE_HOME and added $MAXINE_HOME/bin to the beginning of my path.

Following these instructions, I took it for a little spin. 

# max build

This actually failed (cc: language M1 not recognized) as long as gcc was in the PATH before the SunStudioExpress/bin; swapping those around it began working.


# max helloworld
Hello World



# max vm -cp VM/bin test.output.GCTest2
Could not load main class: java.lang.ClassNotFoundException: test.output.GCTest2

KK, let's troubleshoot that...

# max -v helloworld
/opt/maxine/Native/generated/solaris/maxvm -classpath /opt/maxine/VM/bin util.HelloWorld
Hello World!


# max -v vm -cp VM/bin util.HelloWorld
/opt/maxine/Native/generated/solaris/maxvm -cp VM/bin util.HelloWorld
Could not load main class: java.lang.ClassNotFoundException: util.HelloWorld

# max -v vm -cp /opt/maxine/VM/bin util.HelloWorld
/opt/maxine/Native/generated/solaris/maxvm -cp /opt/maxine/VM/bin util.HelloWorld
Hello World!


Ok, I think I have it...

# max -v vm -cp /opt/maxine/VM/bin test.output.GCTest2
/opt/maxine/Native/generated/solaris/maxvm -cp /opt/maxine/VM/bin test.output.GCTest2
Garbage Collector Test
...
GCTest2 done.

I don't have 'max gate'  working yet and 'max inspect' core dumped while trying to fork... but hey, it's a start.

No comments:

Post a Comment