• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst
  • Peter Rooke
  • Mikalai Zaikin
Bartenders:
  • Himai Minh

Simple Hello World crashed

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote this program "Hello World".
It compiled, preverified, jarred and executed.
Its showing up in the emulator : Select one to launch - HelloWorld. But I click the launch button, it goes back to the DOS mode giving a huge report.
Can anyone tell me what went wrong ?
Thanks


C:\Anjanesh\test>run

C:\Anjanesh\test>C:\WTK21\bin\emulator -Xdescriptor:C:\Anjanesh\test\HelloWorld.
jad
Running with storage root DefaultColorPhone
Method............: 100d2aa8 'com/sun/midp/midlet/MIDletState.createMIDlet (stat
ic)'
Stack Chunk.......: e58cd4
Frame Pointer.....: e58d30
Current IP........: 10128592 = 10128584 + offset 14
Previous Frame....: e58cf4
Previous IP.......: 1012052b (offset 22)
Frame size........: 8 (1 arguments, 7 local variables)
Argument[0].......: e59a9c
Local[1]..........: 0
Local[2]..........: e58cf4
Local[3]..........: e68858
Local[4]..........: e58d08
Local[5]..........: 100dcdd0
Local[6]..........: e58cd4
Local[7]..........: 1015f0a0
Operand[1]........: e59a9c

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

VM status:
Instruction pointer.: 10128592 (offset within invoking method: 14)
Next instruction....: 0x4c
Frame pointer.......: e58d30
Local pointer.......: e58d10
Stack size..........: 128; sp: e58d48; ranges: e58cdc-e58edc;
Contents of the current stack frame:
e58d10: e59a9c (lp)
e58d14: 0
e58d18: e58cf4
e58d1c: e68858
e58d20: e58d08
e58d24: 100dcdd0
e58d28: e58cd4
e58d2c: 1015f0a0
e58d30: e58cf4 (fp)
e58d34: 1012052b
e58d38: e58d0c
e58d3c: 100d2aa8
e58d40: e58cd4
e58d44: 0 (end of frame)
e58d48: e59a9c (sp)
Execution stack contains 112 items:
e59d10
e68a68
e59a9c
0
0
0
0
1
e58cd8
100cd0e4
e58cd4
0
e68a68
e59a9c
0
e58cf4
e68858
e58d08
100dcdd0
e58cd4
1015f0a0
e58cf4
1012052b
e58d0c
100d2aa8
e58cd4
0
e59a9c

Execution completed.
429584 bytecodes executed
10 thread switches
486 classes in the system (including system classes)
2380 dynamic objects allocated (72064 bytes)
1 garbage collections (0 bytes collected)
ALERT: java/lang/ClassFormatError: Bad version information.
Execution completed.
429584 bytecodes executed
10 thread switches
486 classes in the system (including system classes)
2380 dynamic objects allocated (72064 bytes)
1 garbage collections (0 bytes collected)

C:\Anjanesh\test>
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do u have sun supported wireless toolkit?. simply use this kit for test j2me application. This is very useful for u.

further information pls contact
edward_gri@yahoo.co.in
 
Anjanesh Lekshminarayanan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'sun supported wireless toolkit' ?
J2ME Wireless Toolkit provided by Sun is 'sun supported wireless toolkit' ? I used standard J2ME emulator - default grey phone for emulation.
 
Anjanesh Lekshminarayanan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Long time since original date of post but if it helps for others who face this problem.

I am using J2SE 1.5 and WTK 2.1
It seems there are some issues when compiling with J2SE 1.5

Need to compile as if its in version 1.4 :
compile.bat
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh good catch. But how do you mean you are compiling with J2SE 5.0

J2ME is its own set of APIs and is a subset of J2SE, so you can't really use J2SE to compile. the toolkit has J2ME jar files and compiles using those, no J2SE.

Mark
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anjanesh,

I have been trying this now for almost a week and couldn't resolve 'ALERT: java/lang/ClassFormatError: bad version information' error.

I have written a java program using Eclipse 3.3.1 (JRE 1.6) which inject some code directly in a J2ME MIDlet. I do the the preverification of the MIDlet class after modification.

I have tried to compile and preverify my programs from both Eclipse and Command line(as you have suggested) but couldn't get rid of it. Please suggest if you have any solution in Mind.


Regards
Mukesh



Anjanesh Lekshminarayanan wrote:Long time since original date of post but if it helps for others who face this problem.

I am using J2SE 1.5 and WTK 2.1
It seems there are some issues when compiling with J2SE 1.5

Need to compile as if its in version 1.4 :
compile.bat

 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic