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

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

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

The problem is the compilation JRE and running JRE are not the same. So we need to make them the same version, e.g. 1.6.

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

Category >> Real Methods  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
<pre><code> 
String foo = "bar";
</code></pre>