Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 574714 - UnsupportedClassVersionError when launching junit test with execution environment < JavaSE-1.8
Summary: UnsupportedClassVersionError when launching junit test with execution environ...
Status: CLOSED DUPLICATE of bug 574362
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-07 10:21 EDT by Jimmy Praet CLA
Modified: 2021-07-07 10:28 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jimmy Praet CLA 2021-07-07 10:21:47 EDT
When launching a unit test of a project that is configured with execution environment < JavaSE-1.8 (JavaSE-1.7 in my case), I get this error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/eclipse/jdt/internal/junit/runner/RemoteTestRunner, offset=6
	at java.lang.ClassLoader.defineClassImpl(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:324)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:155)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:712)
	at java.net.URLClassLoader.access$400(URLClassLoader.java:93)
	at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1164)
	at java.security.AccessController.doPrivileged(AccessController.java:456)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:595)
	at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:777)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:750)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:326)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:731)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)

Reason: org.eclipse.jdt.junit.runtime_3.6.0 has been compiled with Java 8.
Previous version org.eclipse.jdt.junit.runtime_3.5.0 was compiled with Java 5.
Comment 1 Julian Honnen CLA 2021-07-07 10:28:53 EDT

*** This bug has been marked as a duplicate of bug 574362 ***