Problem when using WTK

J

Jade

Hope anyone can helps .... thanks.

I wrote a simple mobile game using J2ME and can compile it without error,
but when i try to launch it, the following message come out and then .....
exit:

Project settings saved
Building "TestingGame"
Build complete
Running with storage root DefaultColorPhone
Method............: 100d2aa8 'com/sun/midp/midlet/MIDletState.createMIDlet
(static)'
Stack Chunk.......: e87cc4
Frame Pointer.....: e87d20
Current IP........: 10128592 = 10128584 + offset 14
Previous Frame....: e87ce4
Previous IP.......: 1012052b (offset 22)
Frame size........: 8 (1 arguments, 7 local variables)
Argument[0].......: e895cc
Local[1]..........: 0
Local[2]..........: e87ce4
Local[3]..........: e987fc
Local[4]..........: e87cf8
Local[5]..........: 100dcdd0
Local[6]..........: e87cc4
Local[7]..........: 1015f0a0
Operand[1]........: e895cc

Method............: 100cd0e4 'com/sun/midp/midlet/Selector.run (virtual)'
Stack Chunk.......: e87cc4
Frame Pointer.....: e87ce4
Current IP........: 1012052b = 10120515 + offset 22
Previous Frame....: 0
Previous IP.......: 1
Frame size........: 6 (1 arguments, 5 local variables)
Argument[0].......: e89810
Local[1]..........: e98a0c
Local[2]..........: e895cc
Local[3]..........: 0
Local[4]..........: 0
Local[5]..........: 0
Operand[1]........: e98a0c

VM status:
Instruction pointer.: 10128592 (offset within invoking method: 14)
Next instruction....: 0x4c
Frame pointer.......: e87d20
Local pointer.......: e87d00
Stack size..........: 128; sp: e87d38; ranges: e87ccc-e87ecc;
Contents of the current stack frame:
e87d00: e895cc (lp)
e87d04: 0
e87d08: e87ce4
e87d0c: e987fc
e87d10: e87cf8
e87d14: 100dcdd0
e87d18: e87cc4
e87d1c: 1015f0a0
e87d20: e87ce4 (fp)
e87d24: 1012052b
e87d28: e87cfc
e87d2c: 100d2aa8
ALERT: java/lang/ClassFormatError: Bad version information.

e87d30: e87cc4
e87d34: 0 (end of frame)
e87d38: e895cc (sp)
Execution stack contains 112 items:
e89810
e98a0c
e895cc
0
0
0
0
1
e87cc8
100cd0e4
e87cc4
0
e98a0c
e895cc
0
e87ce4
e987fc
e87cf8
100dcdd0
e87cc4
1015f0a0
e87ce4
1012052b
e87cfc
100d2aa8
e87cc4
0
e895cc

Execution completed.
441217 bytecodes executed
9 thread switches
486 classes in the system (including system classes)
2483 dynamic objects allocated (73128 bytes)
1 garbage collections (0 bytes collected)
Execution completed.
441217 bytecodes executed
9 thread switches
486 classes in the system (including system classes)
2483 dynamic objects allocated (73128 bytes)
1 garbage collections (0 bytes collected)
 
T

Thomas Fritsch

Jade said:
Hope anyone can helps .... thanks.

I wrote a simple mobile game using J2ME and can compile it without error,
but when i try to launch it, the following message come out and then .....
exit:

Project settings saved
Building "TestingGame"
Build complete
Running with storage root DefaultColorPhone
[...lots of stuff snipped...]
ALERT: java/lang/ClassFormatError: Bad version information.
See at
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ClassFormatError.html
Some guesses what might have happened:
(*) you compiled for java1.5, but your machine expects java1.4
(the class file format changed with 1.3 -> 1.4, and 1.4 -> 1.5)
(*) or your class files were corrupted during transfer
(*) or something completely different...

[...lots of stuff snipped...]
 
D

Darryl L. Pierce

Jade said:
Hope anyone can helps .... thanks.

I wrote a simple mobile game using J2ME and can compile it without error,
but when i try to launch it, the following message come out and then .....
exit:

Project settings saved
Building "TestingGame"
Build complete
Running with storage root DefaultColorPhone
Method............: 100d2aa8 'com/sun/midp/midlet/MIDletState.createMIDlet
(static)'
Stack Chunk.......: e87cc4

Does your MIDlet have a public, no-arg constructor explicitly defined?
 
D

Darryl L. Pierce

Jade said:

Someone else pointed out that it's a ClassFormatError. This is probably
caused by you using the wrong JDK version. What version are you using
currently?
 
J

Jade

I m using JDK 1.5.0, and J2ME WTK version 2.1
m i using the wrong one? which JDK version i should use???
 
D

Darryl L. Pierce

Jade said:
I m using JDK 1.5.0, and J2ME WTK version 2.1
m i using the wrong one? which JDK version i should use???

JDK 1.4 is the better choice. The bytecodes produced by JDK5 are not in
the right format.
 
D

Darryl L. Pierce

Thomas said:
You *can* use JDK 1.5.0, though.
But then you have to compile for the right target, for example:
javac -target 1.4 ...

Except that you can't tell WTK to use that commandline argument. So,
again, JDK5 doesn't produce what's required (by default) and there's no
way to configure WTK to use the commandline to make the JDK produce the
required bytecode format.

Until Sun releases an updated WTK, it's not possible to use JDK5 to do
MIDP development.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top