preverify error: bad major version number. help me please
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, August 26, 2002 10:24 PM

import com.sun.kjava.*; public class HelloWorld extends Spotlet { Graphics g = Graphics.getGraphics(); public static void main(String[] args) { (new HelloWorld()).register(NO_EVENT_OPTIONS); } public HelloWorld() { g.clearScreen(); g.drawString("HelloWorld",70,70,g.PLAIN); } } this is my source code helloworld I compils it by use this command javac -bootclasspath e:j2me_cldc inapiclasses HelloWorld.java now I got HelloWorld.class and I preverify it by use this command e:j2me_cldc inpreverify -classpath e:j2me_cldc inapiclasses -d . . I got error this error message Error preverifying class Hel   More>>
			
import com.sun.kjava.*;

public class HelloWorld extends Spotlet {
Graphics g = Graphics.getGraphics();

public static void main(String[] args) {
(new HelloWorld()).register(NO_EVENT_OPTIONS);
}
public HelloWorld() {
g.clearScreen();
g.drawString("HelloWorld",70,70,g.PLAIN);
}
}

this is my source code helloworld
I compils it by use this command
javac -bootclasspath e:j2me_cldc inapiclasses HelloWorld.java

now I got HelloWorld.class and I preverify it by use this command
e:j2me_cldc inpreverify -classpath e:j2me_cldc inapiclasses -d . .

I got error this error message
Error preverifying class HelloWorld
Class loading error : Bad major version number

I don't know what is that mean and what should I do?
in my computer now use java version 1.4.0-beta

anyone know please help me

Thank you
   <<Less

Re: preverify error: bad major version number. help me please

Posted By:   J_D  
Posted On:   Friday, September 13, 2002 11:24 AM

I just ran into the same issue and found a solution on the web


Your Java file is being compiled with a version that preverify doesn't understand.
You need to compile your file with a 1.1 version of the javac compiler.
You can do this using your 1.4 SDK and the -target flag, like this:


javac -target 1.1 HelloWorld.java


Then rerun the preverify against the new HelloWorld class file.


Of course your Java file must be compilable using Java as it was back at 1.1.
So for instance you can't use SWING classes which were introduced in Java 1.2


Hope that helps.


JD

About | Sitemap | Contact