11/*******************************************************************************
2- * Copyright (c) 2020 Till Brychcy and others.
2+ * Copyright (c) 2020, 2024 Till Brychcy and others.
33 *
44 * This program and the accompanying materials
55 * are made available under the terms of the Eclipse Public License 2.0
@@ -169,16 +169,16 @@ public void test2Cyclic() throws CoreException, IOException {
169169
170170 @ Test
171171 public void test3RequiredBinaryLevel () throws CoreException , IOException {
172- IPath container = new Path ("org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7 " );
172+ IPath container = new Path ("org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 " );
173173 @ SuppressWarnings ("restriction" )
174174 IVMInstall vm = org .eclipse .jdt .internal .launching .JREContainerInitializer .resolveVM (container );
175175 if (vm == null ) {
176176 return ;
177177 }
178178 if (vm instanceof IVMInstall2 ) {
179179 String version = ((IVMInstall2 ) vm ).getJavaVersion ();
180- if (version == null || !version .startsWith (JavaCore .VERSION_1_7 )) {
181- // higher version instead of JavaSE 1.7 not found:
180+ if (version == null || !version .startsWith (JavaCore .VERSION_1_8 )) {
181+ // higher version instead of JavaSE 1.8 not found:
182182 // skip test as error against vm's class files would be reported
183183 return ;
184184 }
@@ -194,17 +194,17 @@ public void test3RequiredBinaryLevel() throws CoreException, IOException {
194194 String classpath = """
195195 <?xml version="1.0" encoding="UTF-8"?>
196196 <classpath>
197- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7 "/>
197+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 "/>
198198 <classpathentry kind="src" path="src"/>
199199 <classpathentry combineaccessrules="false" kind="src" path="/3_JDKLevelHigh"/>
200200 <classpathentry kind="output" path="bin"/>
201201 </classpath>
202202 """ ;
203203 addFile (fJavaProject1 .getPath (), ".classpath" , classpath );
204204 addFile (src1 .getFullPath (), "LowClass.java" , "public class LowClass{HighClass x;}" );
205- fJavaProject1 .setOption (JavaCore .COMPILER_COMPLIANCE , JavaCore .VERSION_1_7 );
206- fJavaProject1 .setOption (JavaCore .COMPILER_SOURCE , JavaCore .VERSION_1_7 );
207- fJavaProject1 .setOption (JavaCore .COMPILER_CODEGEN_TARGET_PLATFORM , JavaCore .VERSION_1_7 );
205+ fJavaProject1 .setOption (JavaCore .COMPILER_COMPLIANCE , JavaCore .VERSION_1_8 );
206+ fJavaProject1 .setOption (JavaCore .COMPILER_SOURCE , JavaCore .VERSION_1_8 );
207+ fJavaProject1 .setOption (JavaCore .COMPILER_CODEGEN_TARGET_PLATFORM , JavaCore .VERSION_1_8 );
208208 fJavaProject1 .setOption (JavaCore .CORE_INCOMPATIBLE_JDK_LEVEL , JavaCore .ERROR );
209209
210210
@@ -222,15 +222,15 @@ public void test3RequiredBinaryLevel() throws CoreException, IOException {
222222 """ ;
223223 addFile (fJavaProject2 .getPath (), ".classpath" , classpath2 );
224224 addFile (src2 .getFullPath (), "HighClass.java" , "public class HighClass{}" );
225- fJavaProject2 .setOption (JavaCore .COMPILER_COMPLIANCE , JavaCore .VERSION_1_8 );
226- fJavaProject2 .setOption (JavaCore .COMPILER_SOURCE , JavaCore .VERSION_1_8 );
227- fJavaProject2 .setOption (JavaCore .COMPILER_CODEGEN_TARGET_PLATFORM , JavaCore .VERSION_1_8 );
225+ fJavaProject2 .setOption (JavaCore .COMPILER_COMPLIANCE , JavaCore .VERSION_11 );
226+ fJavaProject2 .setOption (JavaCore .COMPILER_SOURCE , JavaCore .VERSION_11 );
227+ fJavaProject2 .setOption (JavaCore .COMPILER_CODEGEN_TARGET_PLATFORM , JavaCore .VERSION_11 );
228228
229229 fJavaProject1 .getProject ().getWorkspace ().build (IncrementalProjectBuilder .FULL_BUILD , null );
230230
231231 IMarker [] markers = fJavaProject1 .getResource ().findMarkers ("org.eclipse.jdt.core.buildpath_problem" , true , IResource .DEPTH_INFINITE );
232232 assertEquals (
233- "Incompatible .class files version in required binaries. Project '3_JDKLevelLow' is targeting a 1.7 runtime, but is compiled against '3_JDKLevelHigh' which requires a 1.8 runtime" ,
233+ "Incompatible .class files version in required binaries. Project '3_JDKLevelLow' is targeting a 1.8 runtime, but is compiled against '3_JDKLevelHigh' which requires a 11 runtime" ,
234234 markers [0 ].getAttribute (IMarker .MESSAGE ));
235235 assertEquals (1 , markers .length );
236236 IMarkerResolution [] resolutions = sortResolutions (IDE .getMarkerHelpRegistry ().getResolutions (markers [0 ]));
0 commit comments