| Summary: | [junit] Can't run tests on JDK older 1.8 | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | KP <pollentierk> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jimmy.praet, loskutov, noopur_gupta, robert.anderlik |
| Version: | 4.20 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=571009 | ||
| Whiteboard: | |||
|
Description
KP
Probably regression (or a deliberate choice) from bug 571009. Noopur, is running JUnit tests on Java < 8 is supported by Eclipse 4.20? (In reply to Andrey Loskutov from comment #1) > Probably regression (or a deliberate choice) from bug 571009. > > Noopur, is running JUnit tests on Java < 8 is supported by Eclipse 4.20? By changing org.eclipse.jdt.junit.runtime compiler settings like below I'm able to run the test on Java 7 (debugging IDE in IDE) diff --git a/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs index e57b044..5429dae 100644 --- a/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs @@ -28,5 +28,5 @@ org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate @@ -135,3 +135,3 @@ org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false I haven't verified if maven/tycho is able to build on Java 8 with target 7, but that could be a possible solution. Another solution would be move to Java 11 and specify --release 7: diff --git a/org.eclipse.jdt.junit.runtime/.classpath b/org.eclipse.jdt.junit.runtime/.classpath index eca7bdb..4a00bec 100644 --- a/org.eclipse.jdt.junit.runtime/.classpath +++ b/org.eclipse.jdt.junit.runtime/.classpath @@ -2,3 +2,7 @@ <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> + <attributes> + <attribute name="module" value="true"/> + </attributes> + </classpathentry> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> diff --git a/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs index e57b044..13b87d2 100644 --- a/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jdt.junit.runtime/.settings/org.eclipse.jdt.core.prefs @@ -28,5 +28,5 @@ org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate @@ -134,4 +134,4 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false diff --git a/org.eclipse.jdt.junit.runtime/META-INF/MANIFEST.MF b/org.eclipse.jdt.junit.runtime/META-INF/MANIFEST.MF index 86c2f9c..688b8c0 100644 --- a/org.eclipse.jdt.junit.runtime/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.junit.runtime/META-INF/MANIFEST.MF @@ -5,3 +5,3 @@ Bundle-SymbolicName: org.eclipse.jdt.junit.runtime;singleton:=true -Bundle-Version: 3.6.0.qualifier +Bundle-Version: 3.7.0.qualifier Bundle-Vendor: %providerName @@ -16,2 +16,2 @@ Require-Bundle: org.junit;bundle-version="3.8.2" -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 (In reply to Andrey Loskutov from comment #1) > Noopur, is running JUnit tests on Java < 8 is supported by Eclipse 4.20? No. All options suggested in comment #2 were discussed with the team and it was a deliberate decision to move compiler settings also to 1.8 (done via bug 571009). (In reply to KP from comment #0) > Then what's the point of selecting the Runtime JRE in the Run Configuration, > or allowing to select a version older than JavaSE-1.8 ? This should be handled as an enhancement / bug fix. > And how can we now test again an older JRE? You will need Eclipse 4.19 or older. *** Bug 574567 has been marked as a duplicate of this bug. *** *** Bug 574714 has been marked as a duplicate of this bug. *** |