Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

while running junit it is throwing java.lang.Unsupported Class Version Error

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
when iam running junit as

java org.junit.runner.JUnitCore org.junit.tests.AllTests

it is throwing the following exception.
i had set the classpath as

C:\junit4.1\junit-4.1.jar;.;

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/junit/runner/JUnitCore (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

how to run the junit need help

thanks in advance
saiprasanna
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JUnit 4 needs Java 5 to run. You are trying to run it under an earlier Java version.
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Preuss iam using j2sdk 1.4.2
regards
saiprasanna
 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have another dought that is JUnit 4.1 providing any other compatable files to run on j2sdk 1.4.2

thanks in advance
saiprasanna
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34671
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sai prasanna:
hi
i have another dought that is JUnit 4.1 providing any other compatable files to run on j2sdk 1.4.2

thanks in advance
saiprasanna

No. JUnit 4 does not provide a version for Java 1.4. It heavily relies on some Jave 5 features including annotations.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34671
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I now see Ilja answered already in your other thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic