I get the error below when trying to run an executable jar file. The file only contains a main with one line "System.out.println("Woo!");" and runs fine in eclipse.
The error means that you have compiled the code with a higher version of java and trying to run it on a older version of jvm.
Since it says major.minor version 51.0 it means that your compiler is java6. So you should run your program on java6 or higher.
1
votes
Your compiled class is in jre 1.5 and your system default jre is different(might be 1.6).
compile your code in same version of jre.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more