Author Topic: junit 19.0.2.5 UnsupportedClassVersionError - Mac OS X  (Read 1001 times)

kagatone

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
junit 19.0.2.5 UnsupportedClassVersionError - Mac OS X
« on: May 27, 2015, 09:45:37 pm »
I've been struggling with this. If I run junit to the same files from a shell I can get it to work but from Slick Edit I'm always getting this error. Has anyone run into this?

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/junit/runner/JUnitCore : Unsupported major.minor version 52.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
   at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

I've been playing with the source and target arguments in Java Options but haven't gotten it to work.

Marcel

  • Senior Community Member
  • Posts: 221
  • Hero Points: 26
Re: junit 19.0.2.5 UnsupportedClassVersionError - Mac OS X
« Reply #1 on: May 28, 2015, 01:33:10 am »
This probably means that the vsjunit.jar that comes with SE has been built with a newer version of Java than what you are using for your project.

You can recompile the vsjunit jar with your JDK to build a compatible version, the source code is in vsjunit of your SE installation.  Better yet, upgrade your project to Java 8 if at all possible.

kagatone

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: junit 19.0.2.5 UnsupportedClassVersionError - Mac OS X
« Reply #2 on: May 29, 2015, 05:26:16 pm »
Thanks - fixed!