www.rodneybeede.com "I would love to change the world, but they won't give me the source code" - unknown

Fixing Unsupported Class Version Error, jUnit, and Eclipse - Last Modified 2008-11-03 22:14 UTC - Created 2008-11-03 22:14 UTC

I kept getting UnsupportedClassVersionError errors when I tried to run a newly created jUnit test (jUnit 4) in Eclipse (3.4).

I had my JRE System Library set for my Java 1.5 JDK. I forgot to change the project settings to use JDK Compliance 1.5 instead of the default of 1.6.

  1. Open your project properties
  2. Java Compiler
  3. Check "Enable project specific settings"
  4. Set "Compiler compliance level:" to 1.5