/nnproject/

Setting up Eclipse IDE for J2ME on Linux (x86_64)


Preparations

Download Eclipse IDE for java package (not newer than 2024-06!):
eclipse.org or 2023-12 from nnproject.cc

Download MTJ plugin

Download JDK 8:
Oracle archive or jdk8u202 i586 from nnproject.cc

Download ProGuard:
SourceForge or 6.2.2 from nnproject.cc

Download KEmulator nnx64 (multi-platform)

Install KEmulator nnx64 dependencies (for running with 32-bit jre):
sudo apt install libgtk2.0-0:i386 libxtst-dev:i386 libatk-adaptor:i386 libgail-common:i386 libcanberra-gtk-module:i386 libxt-dev:i386

Extract JDK, Eclipse, ProGuard and KEmulator.
Launch Eclipse IDE.

IDE Setup

Install MTJ plugin:
Open Help>Install New Software...>Add...>Archive...; locate mtj.zip, click Add.
Agree with every prompt, wait until it asks to restart.

Open Window>Preferences.
Go to Java>Installed JREs, add JDK 8:
Add...>Standard VM, fill in "JRE home" field with path to where you extracted JDK 8, click Finish.
Make it default.

Go to Java ME category, locate path to extracted proguard in field "Proguard Root Directory".
Open Device Management, click Manual Install..
Locate extracted kemnnx64, click Refresh.
When KEmulator nnx64 option appears, click Finish.
* if kemulator doesn't appear there, edit emulator file in kemnnx64/uei as text by adding correct path to java
Make new configuration as default.

Go to Java ME>Packaging>Obfuscation, check "Use specified arguments".
Enter following: -dontusemixedcaseclassnames -dontnote -defaultpackage '' -dontoptimize

Development

Change perspective: Window>Perspective>Open Perspective>Other...>Java ME
Right click in Package Explorer, New>Java ME Project, name your project, click Finish.
Right click at src folder, New>Java ME MIDlet, name your main MIDlet class, click Finish.
Code.

Building

Open Application Descriptor, click Create Package, check Use deployment category, and Obfuscate the code if needed.

Check compiled result

Open output jar package as archive (it will appear in project/deployed/KEmulator), make sure everything is on place.
* if resources are missing, go to Application Descriptor, Build tab, check every item.
* if there is no classes, most likely that preverifier failed to complete. Error Logs or .log file might help.

Launching in emulator

In Application Descriptor, click Launch as emulated Java ME or JAD.
* if JAD does not work, then project was probably renamed. Edit .mtj file in project folder, by setting current name in second line.
2025, nnproject

Site made by rehdzi & shinovon