|
Lines 22-27
Link Here
|
| 22 |
import org.eclipse.core.runtime.Path; |
22 |
import org.eclipse.core.runtime.Path; |
| 23 |
import org.eclipse.core.runtime.Status; |
23 |
import org.eclipse.core.runtime.Status; |
| 24 |
|
24 |
|
|
|
25 |
import org.eclipse.jdt.internal.launching.LaunchingPlugin; |
| 25 |
import org.eclipse.jdt.internal.launching.LibraryInfo; |
26 |
import org.eclipse.jdt.internal.launching.LibraryInfo; |
| 26 |
import org.eclipse.jdt.internal.launching.StandardVMType; |
27 |
import org.eclipse.jdt.internal.launching.StandardVMType; |
| 27 |
|
28 |
|
|
Lines 97-126
Link Here
|
| 97 |
File[] versions= versionDir.listFiles(); |
98 |
File[] versions= versionDir.listFiles(); |
| 98 |
for (int i= 0; i < versions.length; i++) { |
99 |
for (int i= 0; i < versions.length; i++) { |
| 99 |
String version= versions[i].getName(); |
100 |
String version= versions[i].getName(); |
| 100 |
File home= new File(versions[i], JVM_ROOT); |
101 |
File home= new File(versions[i], JVM_ROOT); |
| 101 |
if (home.exists() && findVMInstall(version) == null && !CURRENT_JVM.equals(version)) { |
102 |
if (home.exists()) { |
| 102 |
|
|
|
| 103 |
boolean isDefault= currentJDK.equals(versions[i]); |
103 |
boolean isDefault= currentJDK.equals(versions[i]); |
| 104 |
|
104 |
IVMInstall install= findVMInstall(version); |
| 105 |
VMStandin vm= new VMStandin(this, version); |
105 |
if (install == null && !CURRENT_JVM.equals(version)) { |
| 106 |
vm.setInstallLocation(home); |
106 |
VMStandin vm= new VMStandin(this, version); |
| 107 |
String format= MacOSXLaunchingPlugin.getString(isDefault |
107 |
vm.setInstallLocation(home); |
| 108 |
? "MacOSXVMType.jvmDefaultName" //$NON-NLS-1$ |
108 |
String format= MacOSXLaunchingPlugin.getString(isDefault |
| 109 |
: "MacOSXVMType.jvmName"); //$NON-NLS-1$ |
109 |
? "MacOSXVMType.jvmDefaultName" //$NON-NLS-1$ |
| 110 |
vm.setName(MessageFormat.format(format, new Object[] { version } )); |
110 |
: "MacOSXVMType.jvmName"); //$NON-NLS-1$ |
| 111 |
vm.setLibraryLocations(getDefaultLibraryLocations(home)); |
111 |
vm.setName(MessageFormat.format(format, new Object[] { version } )); |
| 112 |
URL doc= getDefaultJavadocLocation(home); |
112 |
vm.setLibraryLocations(getDefaultLibraryLocations(home)); |
| 113 |
if (doc != null) |
113 |
URL doc= getDefaultJavadocLocation(home); |
| 114 |
vm.setJavadocLocation(doc); |
114 |
if (doc != null) |
| 115 |
|
115 |
vm.setJavadocLocation(doc); |
| 116 |
IVMInstall rvm= vm.convertToRealVM(); |
116 |
|
| 117 |
|
117 |
IVMInstall rvm= vm.convertToRealVM(); |
| 118 |
if (isDefault) { |
118 |
if (isDefault) { |
| 119 |
defaultLocation= home; |
119 |
defaultLocation= home; |
| 120 |
try { |
120 |
try { |
| 121 |
JavaRuntime.setDefaultVMInstall(rvm, null); |
121 |
JavaRuntime.setDefaultVMInstall(rvm, null); |
| 122 |
} catch (CoreException e) { |
122 |
} catch (CoreException e) { |
| 123 |
// NeedWork |
123 |
LaunchingPlugin.log(e); |
|
|
124 |
} |
| 125 |
} |
| 126 |
} else { |
| 127 |
if (isDefault) { |
| 128 |
defaultLocation= home; |
| 129 |
try { |
| 130 |
JavaRuntime.setDefaultVMInstall(install, null); |
| 131 |
} catch (CoreException e) { |
| 132 |
LaunchingPlugin.log(e); |
| 133 |
} |
| 124 |
} |
134 |
} |
| 125 |
} |
135 |
} |
| 126 |
} |
136 |
} |