Tuesday, December 12, 2006

Microemulator on Solaris 2.6

Microemulator is an open source j2me emulator, I find it nice and easy to use. It support applet, so you can access your midp application through web browser.

I have some problem running microemulator from Solaris 2.6, finally I found out why and solve the problem.

microemulator
Microemulator run on Solaris

The binary that I downloaded from the internet was compile as java 1.4 binary, but I get this error when I run java 1.4 on Solaris 2.6:

libjvm.so: symbol getloadavg: referenced symbol not found

This error will happen to java 5 as well. I am not sure the problem can be solved by patching the Solaris 2.6, but I am using the java 1.3.

What I need is to do is re-compile microemulator with java 1.3, I download from sourceforge (version 1.0), change the build.xml file to generate 1.3 code (just change 1.4 to 1.3 will do).

I change AppRecordStoreManager.java
$ vi AppRecordStoreManager.java
(at line 166)
FileOutputStream(recordStoreFile, false) to
FileOutputStream(recordStoreFile)

In 1.3 there is not such constructor, so this is yet another quick and dirty hack.

$ cd microemulator
$ ant

This will create me-app.jar in target directory

$ java -jar mee-app.jar HelloWorld.jad

This will launch your j2me midp program in microemulator, is just easy.

No comments: