use of org.eclipse.jst.server.core.IJavaRuntime in project liferay-ide by liferay.
the class LiferayTomcatRuntimeComposite method updateJREs.
protected void updateJREs() {
IJavaRuntime iJavaRuntime = getJavaRuntime();
IVMInstall currentVM = null;
if ((iJavaRuntime != null) && (iJavaRuntime.getVMInstall() != null)) {
currentVM = iJavaRuntime.getVMInstall();
} else {
currentVM = JavaRuntime.getDefaultVMInstall();
}
int currentJREIndex = -1;
// get all installed JVMs
installedJREs = new ArrayList<>();
IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
int size = vmInstallTypes.length;
for (int i = 0; i < size; i++) {
IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
int size2 = vmInstalls.length;
for (int j = 0; j < size2; j++) {
installedJREs.add(vmInstalls[j]);
}
}
size = installedJREs.size();
jreNames = new String[size + 1];
jreNames[0] = "<Default Workbench JRE>";
for (int i = 0; i < size; i++) {
IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
jreNames[i + 1] = vmInstall.getName();
if (vmInstall.equals(currentVM)) {
currentJREIndex = i + 1;
}
}
if (jreCombo != null) {
jreCombo.setItems(jreNames);
jreCombo.select(currentJREIndex);
}
}
use of org.eclipse.jst.server.core.IJavaRuntime in project webtools.servertools by eclipse.
the class JRERuntimeComponentProvider method getRuntimeComponents.
public List<IRuntimeComponent> getRuntimeComponents(IRuntime runtime) {
// define JRE component
IJavaRuntime javaRuntime = (IJavaRuntime) runtime.loadAdapter(IJavaRuntime.class, null);
if (javaRuntime != null) {
final IVMInstall vmInstall = javaRuntime.getVMInstall();
final IRuntimeComponent rc = StandardJreRuntimeComponent.create(vmInstall);
return Collections.singletonList(rc);
}
return null;
}
Aggregations