wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes Preverify on Windows and Linux differ? PROBLEM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Preverify on Windows and Linux differ? PROBLEM" Watch "Preverify on Windows and Linux differ? PROBLEM" New topic
Author

Preverify on Windows and Linux differ? PROBLEM

MC Otten
Greenhorn

Joined: Dec 03, 2003
Posts: 2
Hi,
I'm using Knoppix 3.3 (Linux), J2ME Wireless TK 2.0.01 for Linux and J2sdk1.4.0_02 for linux. I compile my code like this:
javac -target 1.2 -classpath /usr/local/bin/WTK2.0/lib/midpapi.zip -d /<path>/out/tmpclasses /<path>/out/*.java
The classes appear in tmpclasses. Now I preverify everything:
/usr/local/bin/WTK2.0/bin/preverify -classpath /usr/local/bin/WTK2.0/lib/midpapi.zip -d /<path>/out/classes -cldc /<out>/out/tmpclasses/
The preverified classes appear in classes.
Now this is done, I create a jar file:
/usr/local/bin/j2sdk1.4.2_02/bin/jar cfm /<path>/out/DictionaryApp.jar /<path>/out/MANIFEST.MF -C /<path>/out/classes . -C /<path>/out/res . '
I generate a jad file and my MIDlet suite has born. I copy this suite to my Windows 2000 machine and run the suite with the Nokia emulator. No problem. NOW I try the same with the Sony Ericcson emulator and have the following error:
Error verifying method DictionaryApp$1 <init>(LDictionaryApp;Ljavax/microedition/lcdui/Displayable;Ljavax/microedition/lcdui/Command V
Approximate bytecode offset 2: Bad type on stack
ALERT: Error verifying class DictionaryApp$1
The MIDlet won't work on a Nokia 3650 or Samsung S300 either. But when I use the class files generated by the KToolbar of Nokia, I CAN run the MIDlet on the Ericcson emulator as well as on the Nokia and Samsung. So there must be a difference between the preverify method of the Linux WTK and the Windows WTK. What can I do to solve this?
Greetings,
Matthijs.
[ December 03, 2003: Message edited by: MC Otten ]
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
A couple of things to think about:
1. Does your Linux preverified JAR file work on WTK emulators? (both windows and linux?)
2. Which Nokia emulator on windows did you use? did you use a production emulator or a "concept" emulator?
3. What do you mean by "KToolbar of Nokia"? Did you use the preverify program in Nokia NDS to process your class files on Windows?
4. Finally, you can always compare the Linux and Windows preverified class files directly to see the difference.
But if I were you, I would not bother. It is probably a bug in the preverify program or in the emulator. You have already found a way to work around.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
MC Otten
Greenhorn

Joined: Dec 03, 2003
Posts: 2
Originally posted by Michael Yuan:
A couple of things to think about:
1. Does your Linux preverified JAR file work on WTK emulators? (both windows and linux?)
2. Which Nokia emulator on windows did you use? did you use a production emulator or a "concept" emulator?
3. What do you mean by "KToolbar of Nokia"? Did you use the preverify program in Nokia NDS to process your class files on Windows?
4. Finally, you can always compare the Linux and Windows preverified class files directly to see the difference.
But if I were you, I would not bother. It is probably a bug in the preverify program or in the emulator. You have already found a way to work around.

Hmm seems to me that I didn't use the right javac file on linux. I've entered the entire path to the javac executable and replaced 'classpath' by 'bootclasspath'. It's working now! Thanx anyway for your response.
 
 
subject: Preverify on Windows and Linux differ? PROBLEM