Monday, June 2, 2014

Trouble shooting java.lang.UnsupportedClassVersionError

I encountered an error which stated ‘Exception in thread "main" java.lang.UnsupportedClassVersionError: …. Blah blah blah’ when I tried to run an class as a normal java application in eclipse. The code was fairly simple and hence I definitely had nothing to debug for errors. A little search revealed about the nature of the error and its fix which was again fairly simple and straight forward.

 

I used a default JRE which was included from JDK160_29 corresponding to a weblogic 12c server. But my compiler was set to Java 1.7

 

So all I had to do was change it to 1.6 and my code worked like charm J

 

So in summary the fix to my issue was File->Preferences->Java Compiler->’Compiler Compliance Level’ -> choose between 1.3 to 1.7 to suit your JRE version. In my case it was 1.6

 

 

No comments:

Post a Comment