Bug 410944 - Add Java 8 support to Debug - EE / JRE descriptions

Change-Id: I78d3f59972a6345baedd6f30f569275d465101e9
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
index 814821c..1381e13 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java
@@ -733,7 +733,9 @@
 	 */
 	public static URL getDefaultJavadocLocation(String version) {
 		try {
-			if (version.startsWith(JavaCore.VERSION_1_7)) {
+			if(version.startsWith(JavaCore.VERSION_1_8)) {
+				return new URL("http://download.oracle.com/javase/8/docs/api/"); //$NON-NLS-1$
+			} else if (version.startsWith(JavaCore.VERSION_1_7)) {
 				return new URL("http://download.oracle.com/javase/7/docs/api/"); //$NON-NLS-1$
 			} else if (version.startsWith(JavaCore.VERSION_1_6)) {
 				return new URL("http://download.oracle.com/javase/6/docs/api/"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
index 808475b..bf48210 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/JavaRuntime.java
@@ -918,8 +918,9 @@
 						return entries;
 					}
 				} else {
-					if (isOptional(entry.getClasspathEntry()))
+					if (isOptional(entry.getClasspathEntry())) {
 						return new IRuntimeClasspathEntry[] {};
+					}
 					abort(NLS.bind(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_project___0__3, new String[]{entry.getPath().lastSegment()}), null);
 				}
 				break;
@@ -944,11 +945,13 @@
 				String location = entry.getLocation();
 				if (location != null) {
 					File file = new File(location);
-					if (file.exists())
+					if (file.exists()) {
 						break;
+					}
 				}
-				if (isOptional(entry.getClasspathEntry()))
+				if (isOptional(entry.getClasspathEntry())) {
 					return new IRuntimeClasspathEntry[] {};
+				}
 				abort(NLS.bind(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_archive___0__4, new String[] { entry.getPath().toString() }), null);
 			case IRuntimeClasspathEntry.OTHER:
 				resolver = getContributedResolver(((IRuntimeClasspathEntry2)entry).getTypeId());
@@ -2791,8 +2794,10 @@
             		compliance = JavaCore.VERSION_1_6;
             	} else if (javaVersion.startsWith(JavaCore.VERSION_1_7)) {
             		compliance = JavaCore.VERSION_1_7;
+				} else if (javaVersion.startsWith(JavaCore.VERSION_1_8)) {
+					compliance = JavaCore.VERSION_1_8;
 				} else {
-					compliance = JavaCore.VERSION_1_7; // use latest by default
+					compliance = JavaCore.VERSION_1_8; // use latest by default
 				}
 
             	Hashtable<String, String> options= JavaCore.getOptions();
diff --git a/org.eclipse.jdt.launching/plugin.properties b/org.eclipse.jdt.launching/plugin.properties
index 3209f58..24a6b8c 100644
--- a/org.eclipse.jdt.launching/plugin.properties
+++ b/org.eclipse.jdt.launching/plugin.properties
@@ -55,6 +55,7 @@
 environment.description.8 = CDC 1.1, Foundation 1.1
 environment.description.9 = Java Platform, Standard Edition 6.0
 environment.description.11 = Java Platform, Standard Edition 7.0
+environment.description.12 = Java Platform, Standard Edition 8.0
 
 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 313a94c..2bf3289 100644
--- a/org.eclipse.jdt.launching/plugin.xml
+++ b/org.eclipse.jdt.launching/plugin.xml
@@ -275,7 +275,12 @@
       <environment
             description="%environment.description.11"
             id="JavaSE-1.7"
-            ruleParticipant="org.eclipse.jdt.internal.launching.environments.DefaultAccessRuleParticipant"/>            
+            ruleParticipant="org.eclipse.jdt.internal.launching.environments.DefaultAccessRuleParticipant"/>
+      <environment
+            description="%environment.description.12"
+            id="JavaSE-1.8"
+            ruleParticipant="org.eclipse.jdt.internal.launching.environments.DefaultAccessRuleParticipant">
+      </environment>            
       <analyzer
             class="org.eclipse.jdt.internal.launching.environments.ExecutionEnvironmentAnalyzer"
             id="org.eclipse.jdt.launching.eeAnalyzer"/>