Bug 484026 - If no perfect match is available for an EE

Change-Id: I112f2b5168c1a7b55695465e05b68758fa092141
Signed-off-by: Jens Schiebel <jens.schiebel@gmx.net>
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java
index f7ff8f0..6590850 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -16,6 +16,7 @@
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Arrays;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
@@ -190,7 +191,8 @@
 				}
 			}
 			//try the default VM install: https://bugs.eclipse.org/bugs/show_bug.cgi?id=371300
-			if(vm == null && installs.length > 0) {
+			// if default vm is a match https://bugs.eclipse.org/bugs/show_bug.cgi?id=484026
+			if (vm == null && installs.length > 0 && Arrays.asList(installs).contains(JavaRuntime.getDefaultVMInstall())) {
 				vm = JavaRuntime.getDefaultVMInstall();
 			}
 			// use the first VM failing that