hi folks, I just downloaded j2me wireless toolkit 2.1 and I compiled a sample app, this is its code:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
/**
* A simple Hello World midlet
*
* @see MIDlet
*/
public class Test extends MIDlet {
/**
* Main application screen
*/
private Form mainScreen;
private Display myDisplay;
/**
* Creates a screen for our midlet
*/
public Test() {
myDisplay = Display.getDisplay(this);
mainScreen = new Form("Hello World");
/*
* Create a string item
*/
StringItem strItem = new StringItem("Hello",
"This is a J2ME MIDlet.");
mainScreen.append(strItem);
}
/**
* Start the MIDlet
*/
public void startApp() throws
MIDletStateChangeException {
myDisplay.setCurrent(mainScreen);
}
/**
* Pause the MIDlet
*/
public void pauseApp() {
}
/**
* Called by the framework before
* the application is unloaded
*/
public void destroyApp(boolean unconditional) {
}
}
I clicked on build then run, an generic emulator showed up, when I clicked on launch to run the application, the emnulator exited with the following message on the console. What is wrong? thanks!
Creating project "Test"
Place Java source files in "E:\WTK21\apps\Test\src"
Place application resource files in "E:\WTK21\apps\Test\res"
Place application library files in "E:\WTK21\apps\Test\lib"
Settings updated
Project settings saved
Project settings saved
Building "Test"
Build complete
Running with storage root DefaultColorPhone
Method............: 100d2980 'com/sun/midp/midlet/MIDletState.createMIDlet (static)'
Stack Chunk.......: d17eb0
Frame Pointer.....: d17f0c
Current IP........: 10126161 = 10126153
offset 14
Previous Frame....: d17ed0
Previous IP.......: 1011e41f (offset 22)
Frame size........: 8 (1 arguments, 7 local variables)
Argument[0].......: d19944
Local[1]..........: 0
Local[2]..........: d17ed0
Local[3]..........: d28818
Local[4]..........: d17ee4
Local[5]..........: 100dca28
Local[6]..........: d17eb0
Local[7]..........: 1015c1d8
Operand[1]........: d19944
Method............: 100cd17c 'com/sun/midp/midlet/Selector.run (virtual)'
Stack Chunk.......: d17eb0
Frame Pointer.....: d17ed0
Current IP........: 1011e41f = 1011e409 offset 22
Previous Frame....: 0
Previous IP.......: 1
Frame size........: 6 (1 arguments, 5 local variables)
Argument[0].......: d19be8
Local[1]..........: d28a28
Local[2]..........: d19944
Local[3]..........: 0
Local[4]..........: 0
Local[5]..........: 0
Operand[1]........: d28a28
VM status:
Instruction pointer.: 10126161 (offset within invoking method: 14)
Next instruction....: 0x4c
Frame pointer.......: d17f0c
Local pointer.......: d17eec
Stack size..........: 128; sp: d17f24; ranges: d17eb8-d180b8;
Contents of the current stack frame:
d17eec: d19944 (lp)
d17ef0: 0
d17ef4: d17ed0
d17ef8: d28818
d17efc: d17ee4
d17f00: 100dca28
d17f04: d17eb0
d17f08: 1015c1d8
d17f0c: d17ed0 (fp)
d17f10: 1011e41f
d17f14: d17ee8
d17f18: 100d2980
d17f1c: d17eb0
d17f20: 0 (end of frame)
d17f24: d19944 (sp)
Execution stack contains 112 items:
d19be8
d28a28
d19944
0
0
0
0
1
d17eb4
100cd17c
d17eb0
0
d28a28
d19944
0
d17ed0
d28818
d17ee4
100dca28
d17eb0
1015c1d8
d17ed0
1011e41f
d17ee8
100d2980
d17eb0
0
d19944
Execution completed.
434391 bytecodes executed
8 thread switches
486 classes in the system (including system classes)
2449 dynamic objects allocated (72616 bytes)
1 garbage collections (0 bytes collected)
ALERT: java/lang/ClassFormatError: Bad version information.
Execution completed.
434391 bytecodes executed
8 thread switches
486 classes in the system (including system classes)
2449 dynamic objects allocated (72616 bytes)
1 garbage collections (0 bytes collected)