use of org.eclipse.jdt.launching.AbstractVMInstallType in project mdw-designer by CenturyLinkCloud.
the class ProjectConfigurator method getJreContainerClasspathEntry.
private IClasspathEntry getJreContainerClasspathEntry(String desiredVersion) {
for (IVMInstallType installType : JavaRuntime.getVMInstallTypes()) {
if (installType instanceof AbstractVMInstallType) {
AbstractVMInstallType install = (AbstractVMInstallType) installType;
for (IVMInstall vmInstall : install.getVMInstalls()) {
if (vmInstall instanceof IVMInstall2) {
IVMInstall2 vmInstall2 = (IVMInstall2) vmInstall;
if (vmInstall2.getJavaVersion() != null && vmInstall2.getJavaVersion().startsWith(desiredVersion)) {
IPath containerPath = new Path(JavaRuntime.JRE_CONTAINER);
IPath vmPath = containerPath.append(vmInstall.getVMInstallType().getId()).append(vmInstall.getName());
return JavaCore.newContainerEntry(vmPath);
}
}
}
}
}
return null;
}
Aggregations