Index and 3D demo Midlet
On Linux/Debian :
 #rzr@nrv:WTK104/$ uname -a
 Linux nrv 2.4.22-amiloa #12 mer nov 5 18:34:14 CET 2003 i686 GNU/Linux

 #root@nrv/# apt-get install j2sdk1.4 # j2sdk1.3 may also works ?

 #rzr@nrv:WTK104/$ java -version
 java version "1.4.1"
 Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.1-01)
 Java HotSpot(TM) Client VM (build Blackdown-1.4.1-01, mixed mode)
Download Sun SDK (until a libre one shows up) :
 umask 000 #if root (shared)
 sh j2me_wireless_toolkit-1_0_4_01-bin-linuxi386.bin
 sh j2me_wireless_toolkit-2_0-bin-linuxi386.bin
Test demos :
#rzr@nrv:WTK104/$ ./bin/emulator -Xdescriptor:./apps/games/bin/games.jad
#rzr@nrv:WTK2.1/$ ./bin/emulator -Xdescriptor:./apps/audiodemo/bin/audiodemo.jad
#rzr@nrv:WTK104/$ ./bin/ktoolbar
/opt/WTK2.1/bin/emulator  -XJam:force
Compiling a Simple exemple :
 CFLAGS=-bootclasspath ${API}

 javac ${CFLAGS}
 preverify -classpath ${API}  HelloMIDlet
 cd output && \
 jar cf HelloWorld.jar HelloMIDlet.class

 #rzr@nrv:j2me/$ cat output/HelloWorld.jad
 MIDlet-1: HelloWorld, HelloWorld.png, HelloMIDlet
 MIDlet-Jar-Size: 1178
 MIDlet-Jar-URL: HelloWorld.jar
 MIDlet-Name: HelloWorld
 MIDlet-Vendor: Sun Microsystems
 MIDlet-Version: 1.0

 #rzr@nrv:j2me/$ emulator -Xdescriptor:./output/HelloWorld.jad
Note : Preverification performs certain checks on the Java bytecodes ahead of runtime. If this first verification pass is ok, the preverifier annotates the classfiles (using standard Java bytecode "attributes", so that these are still plain old Java bytecodes and will be executable in VMs not aware of the benefits of preverification), and then saves the annotated class files or passes them along to the next tool in the compile chain.

A Graphics application :

javac -d ./ -bootclasspath /opt/WTK2.1//lib/  \
javac -d ./ -bootclasspath /opt/WTK2.1//lib/  \
preverify \
 -classpath /opt/WTK2.1/lib/ \
 -d ./ SimpleGameMIDlet
preverify \
 -classpath /opt/WTK2.1/lib/ \
 -d ./ SimpleGameCanvas
jar cf SimpleGame.jar SimpleGameCanvas.class SimpleGameMIDlet.class
emulator \
 -classpath /opt/WTK2.1/lib/ \
Other Emulators
Reference SDK : J2ME Mobile Information Device Profile (MIDP) 2.0
Nokia Emu : Nokia Developer's Suite 2.0 for J2ME(TM),6566,034-2,00.html Then request for a SN, finally start
# /opt/Nokia/Tools/Nokia_Developers_Suite_for_J2ME/bin/
# dos2unix \
# /opt/Nokia/Devices/Series_60_MIDP_Concept_SDK_Beta_0_3_1_Nokia_edition/\
bin/emulator Mini3d.jad
Note: Downloading from is worse that a nightmare, if you have some trouble google and P2P may help. I just Hope some day sun will "open" Java (and before M$ supremacy).
ExEn is another API for Games (and more than that) see
Porting a MIDP midlet to ExEn does not cause so much troubles, (look at exen.Gamelet and exen.Graphics, but avoid System.* )

They provide a free downloadable SDK for windows, with a few tricks you can use it on linux (not fully usable for me , so far). Hope this may helps :

# Some settings tricks, after installing SDK to w32 folders
ln -fs /mnt/c/Program\ Files ${HOME}/mnt/program_files/
export SDK_DIR=${HOME}/mnt/program_files/InFusioSDK/

# I use Linux j2sdk (might not be the same version)
javac -bootclasspath ${SDK_DIR}etc/lib/ExEnV2.jar \
 -classpath ${SDK_DIR}etc/lib/ExEnV2.jar:.

wine -- ${SDK_DIR}bin/vmtools/VMTrans.exe  -gp -v -w -vd MyClass

# Genrerating ROM # I got an error on that one ? please help
wine -- ${SDK_DIR}bin/vmtools/exenrom/exenrom.exe  \
-gv -dc . -dr ${SDK_DIR}etc/exenrom/ExEnV2/lexen.rom \
-do le_default.exn

Bad reference format
Severe Error!!!
Severe error(FFFF)

# starting simulator worked  (with win32 compiled binaries)
wine -- ${SDK_DIR}bin/simulator_v2/generic/Color/gensimu.exe  le_default.exn
Please help to make exen 100% supported on linux
Siemens API does not provide a better rasterizer than midp1.0
same old joke : semc_j2me_sdk_v12_09.exe


Here are some common mistakes and their Solutions
Mime Types
# ** Error installing suite (38): JAR did not have the correct media type, it had application/x-java-archive
# Content-Type: application/x-java-archive

# lynx -mime_header -dump
# application/java-archive  jar # @ /etc/apache/mine.types
# or # AddType application/java-archive .jar @ ~/public_html/.htaccess
# AddType text/  jad # is that correct also ?
wbmp                                           image/vnd.wap.wbmp
wml                                            text/vnd.wap.wml
wmlc                                           application/vnd.wap.wmlc
wmlsc                                          application/vnd.wap.wmlscriptc
wmlscript                                      text/vnd.wap.wmlscript
ws                                             text/vnd.wap.wmlscript
wsc                                            application/vnd.wap.wmlscriptc

Just mimetype conventions, If you cant access server settings, other cases a php script may hack it and force mime type
Jad description file
** Error installing suite (25): 
A required suite ID attribute in the JAR manifest 
do not match the one in the JAD
Compare MANIFEST.MF & .jad (byte per byte) and size must match
Diffents API
ALERT: Unable to load class javax/microedition/lcdui/game/GameCanvas
"Application not supported" error
WARNING: Attribute value for MicroEdition-Profile defined in JAR manifest is not supported.

midp1.0 devices dont support midp2.0 API :)
WML installation file
#No MIDlet Suites found. Check the URL to make sure it is correct.
#** Error installing suite (34): 
The JAD to be installed is for an existing suite, 
but not from the same domain as the existing one.
I got this error with WTK1, A html file with a absolute link solved this trouble ! (check for modes)
"error 503 service not available"
On Nokia 7650 reaching a not valid .wml
SDK modes
# The connection dropped, and the installation did not complete. 
Please try installing again
# Unable to create MIDlet Mini3dMIDlet
# Warning: Failed to initialize WMA message routing support

# chmod -R a+rwX /opt/WTK104 
# chmod -R a+rwX /opt/WTK104/appdb/
SDK should not be readonly
ATTENTION: Could not lock System prefs.Unix error code -1113590424.
20 nov. 2003 17:32:31 java.util.prefs.FileSystemPreferences syncWorld
#root@ttyp4[rzr]# mkdir -p /etc/.java/.systemPrefs/
#root@ttyp4[rzr]# #touch /etc/.java/.systemPrefs/.system.lock
This is a inherent java / linux warning
Application Crash
Application dont crash in some emulators (wtk1, wtk2, nokia) but on real device,and No Mesg crash
On Epoc emulator : Program Closed jes-0-javac.microedition.lcdui0@561..
On Nokia 3650 : jes-36e-javax.microedition.lcdui0@1...
I got this bug when merging all my classes into a single one
glass figured out that adding a loop that does setcolor(0,0,0); for 40 ot 80 times or something at the beginning of the paint(graphics g) ..hide that mysterious bug.
Fell free to do further investigations ...


Applet emulator
Bluetooth Hacks :
Wap / Wireless etc
Linux devices :
Aikaspektri Demo Digia have released fantastic graphic demo on Assembly 2002 demo party. 3D animations, great effects and music turn your Nokia 7650 into a true dream machine. Really worth seeing.
IRC : #java , #j2me , #nokia ,
Book: J2ME Game Programming :
Java demos :
3D Hardware for Mobile
C/C++ API :
Last modified: Mon Mar 1 21:52:10 CET 2004