Skip to content

Commit

Permalink
Add JavaSE-23 EE to launching (#426)
Browse files Browse the repository at this point in the history
As jdt.core still doesn't have the Java 23 support JavaSE-23 doesn't
appear in the various places with EE lists but allows Java 23 JVM to be
seen as super set of Java 22.
Work for eclipse-pde/eclipse.pde#1225
  • Loading branch information
akurtakov authored Apr 12, 2024
1 parent 0cd092a commit 60da9ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyz

// XXX: Note that this string is not yet standardized by OSGi, see http://wiki.osgi.org/wiki/Execution_Environment

private static final String JavaSE_23 = "JavaSE-23"; //$NON-NLS-1$
private static final String JavaSE_22 = "JavaSE-22"; //$NON-NLS-1$
private static final String JavaSE_21 = "JavaSE-21"; //$NON-NLS-1$
private static final String JavaSE_20 = "JavaSE-20"; //$NON-NLS-1$
Expand Down Expand Up @@ -108,6 +109,7 @@ public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyz
mappings.put(JavaSE_20, new String[] { JavaSE_19 });
mappings.put(JavaSE_21, new String[] { JavaSE_20 });
mappings.put(JavaSE_22, new String[] { JavaSE_21 });
mappings.put(JavaSE_23, new String[] { JavaSE_22 });
}
@Override
public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
Expand All @@ -133,7 +135,9 @@ public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor)
types = getTypes(CDC_FOUNDATION_1_1);
}
} else {
if (javaVersion.startsWith("22")) { //$NON-NLS-1$
if (javaVersion.startsWith("23")) { //$NON-NLS-1$
types = getTypes(JavaSE_23);
} else if (javaVersion.startsWith("22")) { //$NON-NLS-1$
types = getTypes(JavaSE_22);
} else if (javaVersion.startsWith("21")) { //$NON-NLS-1$
types = getTypes(JavaSE_21);
Expand Down
1 change: 1 addition & 0 deletions org.eclipse.jdt.launching/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ environment.description.23 = Java Platform, Standard Edition 19
environment.description.24 = Java Platform, Standard Edition 20
environment.description.25 = Java Platform, Standard Edition 21
environment.description.26 = Java Platform, Standard Edition 22
environment.description.27 = Java Platform, Standard Edition 23

classpathVariableInitializer.deprecated = Use the JRE System Library instead

Expand Down
5 changes: 5 additions & 0 deletions org.eclipse.jdt.launching/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@
id="JavaSE-22"
compliance="22">
</environment>
<environment
description="%environment.description.27"
id="JavaSE-23"
compliance="23">
</environment>
<analyzer
class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
id="org.eclipse.jdt.launching.eeAnalyzer"/>
Expand Down

0 comments on commit 60da9ec

Please sign in to comment.