Bug 470616: [1.9] JavaSE-1.9 Execution Environment should set compiler source and target level to 1.8
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java
index 26f9738..0a34e83 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironment.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -451,6 +455,7 @@
if (is != null) {
Properties profile = new Properties();
profile.load(is);
+ fixJavaSE19SourceTargetLevels(profile);
return profile;
}
} catch (IOException e) {
@@ -459,6 +464,14 @@
return null;
}
+ private void fixJavaSE19SourceTargetLevels(Properties profile) {
+ if (!ExecutionEnvironmentAnalyzer.JavaSE_1_9.equals(getId())) {
+ return;
+ }
+ profile.setProperty(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); // TODO: at the moment, there's no new Java language feature
+ profile.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8); // TODO: at the moment, runtime doesn't support a new class file version
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jdt.launching.environments.IExecutionEnvironment#getSubEnvironments()
*/
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java
index b1ff6d7..5cabd09 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/ExecutionEnvironmentAnalyzer.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -36,7 +40,7 @@
public class ExecutionEnvironmentAnalyzer implements IExecutionEnvironmentAnalyzerDelegate {
// XXX: Note that this string is not yet standardized by OSGi, see http://wiki.osgi.org/wiki/Execution_Environment
- private static final String JavaSE_1_9 = "JavaSE-1.9"; //$NON-NLS-1$
+ static final String JavaSE_1_9 = "JavaSE-1.9"; //$NON-NLS-1$
private static final String JavaSE_1_8 = "JavaSE-1.8"; //$NON-NLS-1$
private static final String JavaSE_1_7 = "JavaSE-1.7"; //$NON-NLS-1$