First, a wireless toolkit (J2ME SDK) is needed. The mpowerplayer toolkit supports OSX and it comes with a preverifier. The MicroEmulator toolkit has a better emulator than mpowerplayer though.
Once a source file is provided, it is compiled by:
javac -bootclasspath /path/cldc-1.1.jar:/path/midp-2.0.jar /package/path/Source.java
bootclasspathoption uses the specified library files for the compilation, instead of the normal Java environment.
The next step is to preverify the class:
mpowerplayer-folder/osx/preverify/preverify -classpath /path/cldc-1.1.jar:/path/midp-2.0.jar package.name.Source
The preverifier default is to create a folder called output with the same package structure in the current directory. The preverified file is placed there.
In the output folder, create a Manifest.mf with the following:
Also in the output folder, create a jar file:
jar cvfm Source.jar Manifest.mf ./com
The penultimate step is to create a jad file descriptor, Source.jad, with the following:
MIDlet-1: Source, , package.name.Source
The last step is to fill in
MIDlet-Jar-Sizewith the actual number of bytes the jar file takes up. This completes compiling and packaging.
Testing the packaged app in an emulator:
java -jar microemulator-folder/microemulator.jar Source.jad
Allowing the default behaviour of downloading the jad file, which then installs the jar file, set the
Sites of Interest:
J2ME Development on OS X
J2ME Development on OS X, revisited