Eclipse: java.lang.UnsupportedClassVersionError: Bad version number in .class file

While I was programming for a small project under eclipse IDE, I got the following error message:

java.lang.UnsupportedClassVersionError: Bad version number in .class file

The reason for me is that the compilation JRE and running JRE are not the same. So first to make them the same version, such as 1.5.22.

There also might be the JRE library in your respective project. This time you can just remove one JRE from the build path.

TO remove from the build path, go to Project -> BulidPath -> cofigureBuildPath -> Library tab

Related posts: