Reputation: 1
I have an odd one for you. I have a simple .jar
installer program that I wrote in Eclipse on my MacBook Pro, running OS X 10.6.8. When I run the program in Windows 7, Vista and XP; works like a dream. However, when I try and run it in OS X 10.6.8, the program will execute like it should, however when it completes its execution I get the "Bad version number in .class file"
error message.
I ran "java -version"
from the terminal and got
java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
I also confirmed that Eclipse's compiler is using Java 1.6 for everything. As I have scoured the forums it looks like this error prevents the running of the program; but I have yet to see anything about the error showing up after the program has already run.
Upvotes: 0
Views: 1900
Reputation: 4017
Bad version number in .class file means the program was compiled in a newer version of JDK and you are attempting to run it in an older version of JVM.
E.G. you compiled using java 5.0 and are attempting to run using java 1.2.
Upvotes: 2
Reputation: 20077
Do you have some dependencies in the project? Like external .jar files (either as separate .jars or classes repacked to your jar)? They could be compiled with newer version of java (1.7 maybe?) or a bit newer version of 1.6 (on Windows there is 1.6.26 now - Mac version usually lags a bit).
Upvotes: 0