beta_java_18_3 branch merged  to master
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
index fbb36a9..33f200f 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaJRETab.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -322,7 +322,7 @@
 				AbstractVMInstall install = (AbstractVMInstall) vm;
 				String vmver = install.getJavaVersion();
 				if(vmver != null) {
-					int val = compliance.compareTo(vmver);
+					int val = JavaCore.compareJavaVersions(compliance, vmver);
 					if(val > 0) {
 						String setting = null;
 						if (environmentId == null) {
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java
index 4e8dd20..445c369 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- *  Copyright (c) 2005, 2015 IBM Corporation and others.
+ *  Copyright (c) 2005, 2018 IBM Corporation and others.
  *  All rights reserved. This program and the accompanying materials
  *  are made available under the terms of the Eclipse Public License v1.0
  *  which accompanies this distribution, and is available at
@@ -32,6 +32,7 @@
 import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.internal.launching.LaunchingPlugin;
 import org.eclipse.jdt.launching.IVMInstall;
 import org.eclipse.jdt.launching.IVMInstallChangedListener;
@@ -189,6 +190,34 @@
 		return collection.toArray(new Analyzer[collection.size()]);
 	}
 
+	private String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
+		String desc = executionEnvironment.getId();
+		if (desc.indexOf(JavaCore.VERSION_10) != -1) {
+			return JavaCore.VERSION_10;
+		} else if (desc.indexOf(JavaCore.VERSION_9) != -1) {
+			return JavaCore.VERSION_9;
+		} else if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
+			return JavaCore.VERSION_1_8;
+		} else if (desc.indexOf(JavaCore.VERSION_1_7) != -1) {
+			return JavaCore.VERSION_1_7;
+		} else if (desc.indexOf(JavaCore.VERSION_1_6) != -1) {
+			return JavaCore.VERSION_1_6;
+		} else if (desc.indexOf(JavaCore.VERSION_1_5) != -1) {
+			return JavaCore.VERSION_1_5;
+		} else if (desc.indexOf(JavaCore.VERSION_1_4) != -1) {
+			return JavaCore.VERSION_1_4;
+		} else if (desc.indexOf(JavaCore.VERSION_1_3) != -1) {
+			return JavaCore.VERSION_1_3;
+		} else if (desc.indexOf(JavaCore.VERSION_1_2) != -1) {
+			return JavaCore.VERSION_1_2;
+		} else if (desc.indexOf(JavaCore.VERSION_1_1) != -1) {
+			return JavaCore.VERSION_1_1;
+		} else if (desc.indexOf("1.0") != -1) { //$NON-NLS-1$
+			return "1.0"; //$NON-NLS-1$
+		}
+		return JavaCore.VERSION_1_3;
+	}
+
 	private synchronized void initializeExtensions() {
 		if (fEnvironments == null) {
 			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.ID_PLUGIN, JavaRuntime.EXTENSION_POINT_EXECUTION_ENVIRONMENTS);
@@ -196,7 +225,13 @@
 			fEnvironments = new TreeSet<>(new Comparator<IExecutionEnvironment>() {
 				@Override
 				public int compare(IExecutionEnvironment o1, IExecutionEnvironment o2) {
-					return o1.getId().compareTo(o2.getId());
+					String compliance1 = getExecutionEnvironmentCompliance(o1);
+					String compliance2 = getExecutionEnvironmentCompliance(o2);
+					int result = JavaCore.compareJavaVersions(compliance1, compliance2);
+					if (result == 0) {
+						return o1.getId().compareTo(o2.getId());
+					}
+					return result;
 				}
 			});
 			fRuleParticipants = new LinkedHashSet<>();
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 1403038..d127927 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
@@ -444,20 +444,29 @@
 	 * @return properties or <code>null</code> if none
 	 */
 	private Properties getJavaProfileProperties(Bundle bundle, String path) {
+		Properties profile = new Properties();
 		URL profileURL = bundle.getEntry(path);
 		if (profileURL != null) {
 			try (InputStream is = profileURL.openStream()) {
 				profileURL = FileLocator.resolve(profileURL);
 				if (is != null) {
-					Properties profile = new Properties();
 					profile.load(is);
 					fixJavaSE9ComplianceSourceTargetLevels(profile);
-					return profile;
 				}
 			} catch (IOException e) {
+				return null;
 			}
+		} else {
+			if (getCompliance() == null) {
+				return null;
+			}
+			profile.setProperty(JavaCore.COMPILER_COMPLIANCE, getCompliance());
+			profile.setProperty(JavaCore.COMPILER_SOURCE, getCompliance());
+			profile.setProperty(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, getCompliance());
+			profile.setProperty("org.eclipse.jdt.core.compiler.problem.assertIdentifier", "error"); //$NON-NLS-1$ //$NON-NLS-2$
+			profile.setProperty("org.eclipse.jdt.core.compiler.problem.enumIdentifier", "error"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
-		return null;
+		return profile;
 	}
 
 
@@ -519,4 +528,8 @@
 		}
 		return null;
 	}
+
+	private String getCompliance() {
+		return fElement.getAttribute("compliance"); //$NON-NLS-1$
+	}
 }
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 a4e3ea9..e86177d 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2006, 2016 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -36,6 +36,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_10 = "JavaSE-10"; //$NON-NLS-1$
 	static final String JavaSE_9 = "JavaSE-9"; //$NON-NLS-1$
 	private static final String JavaSE_1_8 = "JavaSE-1.8"; //$NON-NLS-1$
 
@@ -76,6 +77,7 @@
 		mappings.put(JavaSE_1_7, new String[] {JavaSE_1_6});
 		mappings.put(JavaSE_1_8, new String[] { JavaSE_1_7 });
 		mappings.put(JavaSE_9, new String[] { JavaSE_1_8 });
+		mappings.put(JavaSE_10, new String[] { JavaSE_9 });
 	}
 	@Override
 	public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
@@ -101,7 +103,9 @@
 					types = getTypes(CDC_FOUNDATION_1_1);
 				}
 			} else {
-				if (javaVersion.startsWith("9")) { //$NON-NLS-1$
+				if (javaVersion.startsWith("10")) { //$NON-NLS-1$
+					types = getTypes(JavaSE_10);
+				} else if (javaVersion.startsWith("9")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_9);
 				} else if (javaVersion.startsWith("1.8")) { //$NON-NLS-1$
 					types = getTypes(JavaSE_1_8);
diff --git a/org.eclipse.jdt.launching/plugin.properties b/org.eclipse.jdt.launching/plugin.properties
index f4c43bd..b218c27 100644
--- a/org.eclipse.jdt.launching/plugin.properties
+++ b/org.eclipse.jdt.launching/plugin.properties
@@ -1,10 +1,10 @@
 ###############################################################################
-# Copyright (c) 2000, 2016 IBM Corporation and others.
+# Copyright (c) 2000, 2018 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
-#
+ 
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
@@ -66,6 +66,7 @@
 environment.description.11 = Java Platform, Standard Edition 7.0
 environment.description.12 = Java Platform, Standard Edition 8.0
 environment.description.13 = Java Platform, Standard Edition 9
+environment.description.14 = Java Platform, Standard Edition 10
 
 classpathVariableInitializer.deprecated = Use the JRE System Library instead
 
diff --git a/org.eclipse.jdt.launching/plugin.xml b/org.eclipse.jdt.launching/plugin.xml
index 5dd8125..0789257 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <!--
-     Copyright (c) 2005, 2017 IBM Corporation and others.
+     Copyright (c) 2005, 2018 IBM Corporation and others.
      All rights reserved. This program and the accompanying materials
      are made available under the terms of the Eclipse Public License v1.0
      which accompanies this distribution, and is available at
      http://www.eclipse.org/legal/epl-v10.html
-    
+ 
      Contributors:
          IBM Corporation - initial API and implementation
  -->
@@ -311,6 +311,12 @@
             description="%environment.description.13"
             id="JavaSE-9"
             ruleParticipant="org.eclipse.jdt.internal.launching.environments.DefaultAccessRuleParticipant">
+      </environment> 
+      <environment
+            description="%environment.description.14"
+            id="JavaSE-10"
+            compliance="10"
+            ruleParticipant="org.eclipse.jdt.internal.launching.environments.DefaultAccessRuleParticipant">
       </environment>            
       <analyzer
             class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
diff --git a/org.eclipse.jdt.launching/schema/executionEnvironments.exsd b/org.eclipse.jdt.launching/schema/executionEnvironments.exsd
index f777cf1..9af7c07 100644
--- a/org.eclipse.jdt.launching/schema/executionEnvironments.exsd
+++ b/org.eclipse.jdt.launching/schema/executionEnvironments.exsd
@@ -99,6 +99,13 @@
                </appInfo>
             </annotation>
          </attribute>
+         <attribute name="compliance" type="string">
+            <annotation>
+               <documentation>
+                  In the absence of profileProperties this will provide the value for org.eclipse.jdt.core.compiler.compliance
+               </documentation>
+            </annotation>
+         </attribute>
       </complexType>
    </element>