Skip to content
Elvis Chidera

Build J2ME apps with a J2ME phone - From the archive

J2ME, Java2 min read

I will show you how to use this app on your java or Symbian phone to create an app.

First, download the J2ME SDK MOBILE from Open the app and click on New Project. Enter HelloWorld as the Project Name and select a directory to save the project files by clicking on browse.

Click Create and allow access until you see Source Packages and Resources. Open Source Packages, press Options(left soft key), go down and select Project Properties.

Select Build, select Creating JAR. Change JAD file Name from HelloWorld.jad to HelloWorld_jad and JAR file Name from HelloWorld.jar to HelloWorld_jar.

Go back and press Ok again and allow access.

You would be taken back to Source Packages, press Options(left soft key) again. Select New. Select MIDlet as the File Type, click Next. Change MIDlet Name to HelloWorld and Class Name to HelloWorld (they don't have to be the same), leave MIDlet Icon empty for now then click finish and allow access.

You will be taken to a white background with codes (the editor screen).

Clear every line of code by pressing 5. Copy the codes below into the editor.
1import javax.microedition.midlet.*;
2import javax.microedition.lcdui.*;
4public class HelloWorld extends MIDlet {
6 public void startApp() {
7 Form f = new Form("My first app");
8 f.append("Hello World");
9 Display.getDisplay(this).setCurrent(f);
10 }
12 public void pauseApp() {
13 }
15 public void destroyApp(boolean unconditional) {
16 }

Click Save(OK), which takes you back to the editor. Press Menu(right soft key) and click on Build(it has a hammer icon), allow access until the app closes. Open the app again for compiling, allow access until it closes. Open the app again for pre-verifying, allow access as usual until it closes. Open the app the last time for jar-ing, it probably gives you an error like this:

pre-jar: do-jar: Failed to write to file BUILD FAILED.

When you get that message or even if you don't, exit the app and open blueFTP (if you don't have one, search for it on and download). Go to the Project Folder with blueFTP, go to the build folder, copy and go to preverified folder and create a new folder there named META-INF, and paste the file into the new folder. Go back to the preverified folder and mark HelloWorld.class and META-INF, press Menu(left soft key), and select Compress items(jar). Change JAR name to HelloWorld_jar then press OK and allow access until you get compression completed successfully.

Exit BlueFTP and go to the preverifed folder without any app and rename the file from HelloWorld_jar to HelloWorld.jar. Open the HelloWorld app and you will get a Hello World Message.

Bravo, you just built your first app with J2ME SDK MOBILE.

© 2020 by Elvis Chidera. All rights reserved.