Fixing Unsupported Class Version Error, jUnit, and Eclipse

Last Modified: Mon, 03 Nov 2008 22:14:00 +0000 ; Created: Mon, 03 Nov 2008 22:14:00 +0000

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