Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Invalid .jar file

2 replies · 16,559 views · Started 22 June 2009

Reference: http://adhocstart.wordpress.com/2009/06/02/j2me_1/


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloWorld extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tbox;

public HelloWorld() {
exitCommand = new Command(�Exit�, Command.EXIT, 1);
tbox = new TextBox(�Hello world MIDlet�, �Hello World!�, 25, 0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}

protected void startApp() {
Display.getDisplay(this).setCurrent(tbox);
}

protected void pauseApp() {}
protected void destroyApp(boolean bool) {}

public void commandAction(Command cmd, Displayable disp) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}

I followed the instructions and the Emulator thing showed "Hello World".
when i got the .jad and .jar files from C:\EclipseWorkspace\HelloWorld\.eclipseme.tmp\emulation

and ran the .jad, the phone tells me that the .jar file is invalid.

in addition how do i build the .jar from Eclipse using Java ME, instead of having it in the tmp folder?

Most likely, you've the wrong MIDP/CLDC version in the manifest file. E.g., MIDP 2.1 when the phone is a MIDP 2.0 model, for example.

What is correct depends on which phone model you have.

N/A wrote:Most likely, you've the wrong MIDP/CLDC version in the manifest file. E.g., MIDP 2.1 when the phone is a MIDP 2.0 model, for example.

What is correct depends on which phone model you have.

hmm... u r right. but now, it returns the error message "Unable to install" when i try to run the .jar file.

when i try to run the .jad file, it says "Compulsory Attributes Missing".