| author | Samrat Dhillon | 2012-02-21 17:09:32 (EST) |
|---|---|---|
| committer | Mike Rennie | 2012-02-21 17:09:32 (EST) |
| commit | 919e71f91e5624d95d0c135fdb24658caa756d70 (patch) (side-by-side diff) | |
| tree | 0cddd9f2aa1e92a63d5562fd6c3bc39a422fb2a7 | |
| parent | 215d5294b36ef64564f7316e7b0f50d9cd229d27 (diff) | |
| download | eclipse.jdt.debug-919e71f91e5624d95d0c135fdb24658caa756d70.zip eclipse.jdt.debug-919e71f91e5624d95d0c135fdb24658caa756d70.tar.gz eclipse.jdt.debug-919e71f91e5624d95d0c135fdb24658caa756d70.tar.bz2 | |
Bug 371300 - JavaRuntime computeVMInstall method returns the first VMv20120221-2209
instead of the workspace default VM if no compatible VM version is found
for the given launch configuration
| -rw-r--r-- | org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/JREContainerInitializer.java | 10 |
1 files changed, 7 insertions, 3 deletions
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 42fd827..f5b89fd 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, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 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 @@ -181,16 +181,20 @@ public class JREContainerInitializer extends ClasspathContainerInitializer { IVMInstall install = installs[i]; if (environment.isStrictlyCompatible(install)) { vm = install; - if (installs.length == 0 && JREContainer.DEBUG_JRE_CONTAINER) { + if (JREContainer.DEBUG_JRE_CONTAINER) { System.out.println("\tPerfect Match: " + vm.getName()); //$NON-NLS-1$ } break; } } + //try the default VM install: https://bugs.eclipse.org/bugs/show_bug.cgi?id=371300 + if(vm == null && installs.length > 0) { + vm = JavaRuntime.getDefaultVMInstall(); + } // use the first VM failing that if (vm == null && installs.length > 0) { vm = installs[0]; - if (installs.length == 0 && JREContainer.DEBUG_JRE_CONTAINER) { + if (JREContainer.DEBUG_JRE_CONTAINER) { System.out.println("\tFirst Match: " + vm.getName()); //$NON-NLS-1$ } } |

