0
votes

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.

I'm not sure how to read these error messages.

UnsupportedClassVersionError exception trace

(too new to post images correctly)

2

2 Answers

3
votes

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.