[CLUE-Tech] java.lang.ClassFormatError: Bad major version number

Dave Anselmi anselmi at americanisp.net
Tue Nov 20 18:09:34 MST 2001


Roger Frank wrote:

> I am putting together some demonstration applets for computer
> science teachers.  What I write works fine with appletviewer
> but when I try to run it with any browser, it fails.  To know
> that it's probably not just my bad code, I ran some applets
> on the CDROM that came with a Java Programming for Dummies
> book no problem.  Then I recompiled them and ran them in
> appletviewer, no problem, but in a browser I get the
> "version number" error.

This message seems to be from a pre-Java2 VM.  Java class files are
versioned (because the format changes over time) so this tells you your
VM (probably 1.1.x) can't read your class file (probably > 1.2).  I
don't know whether the class file version numbers match the Java version
numbers.

Perhaps if you look at your browser docs, you can find a way to upgrade
its VM (konqueror uses a standalone VM - easy).  Or maybe there's an
applet plugin as Sean suggested.

In the end, it may be easier to compile under 1.1 (watch your CLASSPATH,
that it points to the JDK you expect).

Dave





More information about the clue-tech mailing list