Author: rob.stryker(a)jboss.com
Date: 2013-01-11 11:22:37 -0500 (Fri, 11 Jan 2013)
New Revision: 44657
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java
Log:
JBIDE-13368 - strictly matching vm exec environment
Modified:
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java
===================================================================
---
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java 2013-01-11
13:40:24 UTC (rev 44656)
+++
branches/jbosstools-3.3.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractLocalJBossServerRuntime.java 2013-01-11
16:22:37 UTC (rev 44657)
@@ -83,6 +83,26 @@
IVMInstall[] installs = getExecutionEnvironment().getCompatibleVMs();
if( getExecutionEnvironment().getDefaultVM() != null )
return getExecutionEnvironment().getDefaultVM();
+
+ IVMInstall workspaceDefault = JavaRuntime.getDefaultVMInstall();
+
+ // Find an install that is strictly compatible first
+ for (int i = 0; i < installs.length; i++) {
+ IVMInstall install = installs[i];
+ if (getExecutionEnvironment().isStrictlyCompatible(install)) {
+ return install;
+ }
+ }
+
+ // If there aren't any, check if the workspace default vm is in the list of
compatible vms
+ if( installs != null && workspaceDefault != null ) {
+ for( int i = 0; i < installs.length; i++) {
+ if( workspaceDefault.equals(installs[i]))
+ return workspaceDefault;
+ }
+ }
+
+ // Otherwise, return the first vm of any compatability
if( installs != null && installs.length > 0 && installs[0] != null
)
return installs[0];
}
Show replies by date