public static IVMInstall[] getAllVMInstances() { ArrayList<IVMInstall> res = new ArrayList<>(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstall[] installs = types[i].getVMInstalls(); for (int k = 0; k < installs.length; k++) { res.add(installs[k]); } } return res.toArray(new IVMInstall[res.size()]); }
/** * Returns all defined VMs * * @return IVMInstall[] */ protected static IVMInstall[] getAllVMs() { IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); List vms = new ArrayList(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { vms.add(installs[j]); } } return (IVMInstall[])vms.toArray(new IVMInstall[vms.size()]); }
private IVMInstall[] getWorkspaceJREs() { List standins = new ArrayList(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return ((IVMInstall[])standins.toArray(new IVMInstall[standins.size()])); }
private IVMInstall[] getWorkspaceJREs() { List<VMStandin> standins = new ArrayList<>(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return standins.toArray(new IVMInstall[standins.size()]); }
private IVMInstall[] getWorkspaceJREs() { List<VMStandin> standins = new ArrayList<>(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return standins.toArray(new IVMInstall[standins.size()]); }
private IVMInstall[] getWorkspaceJREs() { final List<VMStandin> standins = new ArrayList<>(); final IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { final IVMInstallType type = types[i]; final IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { final IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } return standins.toArray(new IVMInstall[standins.size()]); }
private IVMInstall findVM(File jvmHome) { IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (IVMInstallType type : types) { IVMInstall[] installs = type.getVMInstalls(); for (IVMInstall install : installs) { if (jvmHome.equals(install.getInstallLocation())) { return install; } } } return null; }
private IVMInstall findJre(String version, File location) throws Exception { for (IVMInstallType vmInstallType : JavaRuntime.getVMInstallTypes()) { for (IVMInstall vmInstall : vmInstallType.getVMInstalls()) { File installLocation = vmInstall.getInstallLocation(); if (location.equals(installLocation)) { return vmInstall; } } } return null; } }
private IVMInstall findFirstJava5OrGreaterJvm(IVMInstall jvmInstall) throws UnknownJvmVersionException { IVMInstall[] installs = jvmInstall.getVMInstallType().getVMInstalls(); for (IVMInstall candidate : installs) { if (parseMajorVersion(candidate) >= 5) { return candidate; } } return null; }
private IVMInstall find50OrGreaterVMInstall() { IVMInstallType[] installTypes= JavaRuntime.getVMInstallTypes(); for (int i= 0; i < installTypes.length; i++) { IVMInstall[] installs= installTypes[i].getVMInstalls(); for (int k= 0; k < installs.length; k++) { if (is50orGreaterVMInstall(installs[k])) { return installs[k]; } } } return null; }
/** * Populates the JRE table with existing JREs defined in the workspace. */ protected void fillWithWorkspaceJREs() { // fill with JREs List standins = new ArrayList(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } setJREs((IVMInstall[])standins.toArray(new IVMInstall[standins.size()])); }
private IVMInstall getVMInstall(String name) { IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstall[] installs = types[i].getVMInstalls(); for (int k = 0; k < installs.length; k++) { if (installs[i].getName().equals(name)) return installs[i]; } } return JavaRuntime.getDefaultVMInstall(); }
/** * Populates the JRE table with existing JREs defined in the workspace. */ protected void fillWithWorkspaceJREs() { // fill with JREs List standins = new ArrayList(); IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstallType type = types[i]; IVMInstall[] installs = type.getVMInstalls(); for (int j = 0; j < installs.length; j++) { IVMInstall install = installs[j]; standins.add(new VMStandin(install)); } } setJREs(standins); }
private void processVMInstallType(IVMInstallType installType, List<IPath> locations, List<String> labels) { if (installType != null) { IVMInstall[] installs= installType.getVMInstalls(); boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS()); for (int i= 0; i < installs.length; i++) { String label= getFormattedLabel(installs[i].getName()); LibraryLocation[] libLocations= installs[i].getLibraryLocations(); if (libLocations != null) { processLibraryLocation(libLocations, label); } else { IPath filePath= Path.fromOSString(installs[i].getInstallLocation().getAbsolutePath()); // On MacOS X, install locations end in an additional "/Home" segment; remove it. if (isMac && "Home".equals(filePath.lastSegment())) //$NON-NLS-1$ filePath= filePath.removeLastSegments(1); locations.add(filePath); labels.add(label); } } } }
private static File findJavaDocCommand() { IVMInstall install= JavaRuntime.getDefaultVMInstall(); if (install != null) { File res= getCommand(install); if (res != null) { return res; } } IVMInstallType[] jreTypes= JavaRuntime.getVMInstallTypes(); for (int i= 0; i < jreTypes.length; i++) { IVMInstallType jreType= jreTypes[i]; IVMInstall[] installs= jreType.getVMInstalls(); for (int k= 0; k < installs.length; k++) { File res= getCommand(installs[k]); if (res != null) { return res; } } } return null; }
public IVMInstall getVMInstall() { if (getVMInstallTypeId() == null) return JavaRuntime.getDefaultVMInstall(); try { IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId()); IVMInstall[] vmInstalls = vmInstallType.getVMInstalls(); int size = vmInstalls.length; String id = getVMInstallId(); for (int i = 0; i < size; i++) { if (id.equals(vmInstalls[i].getId())) return vmInstalls[i]; } } catch (Exception e) { // ignore } return null; }
public IVMInstall getVMInstall() { if (getVMInstallTypeId() == null) return JavaRuntime.getDefaultVMInstall(); try { IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId()); IVMInstall[] vmInstalls = vmInstallType.getVMInstalls(); int size = vmInstalls.length; String id = getVMInstallId(); for (int i = 0; i < size; i++) { if (id.equals(vmInstalls[i].getId())) return vmInstalls[i]; } } catch (Exception e) { // ignore } return null; }
/** * Contstructs a new VM updater to update VM install settings. */ public JREsUpdater() { fOriginalVMs = new VMDefinitionsContainer(); IVMInstall def = JavaRuntime.getDefaultVMInstall(); if (def != null) { fOriginalVMs.setDefaultVMInstallCompositeID(JavaRuntime.getCompositeIdFromVM(def)); } IVMInstallType[] types = JavaRuntime.getVMInstallTypes(); for (int i = 0; i < types.length; i++) { IVMInstall[] vms = types[i].getVMInstalls(); for (int j = 0; j < vms.length; j++) { fOriginalVMs.addVM(vms[j]); } } }
/** * Returns the listing of currently installed VMs as a single XML file * @return an XML representation of all of the currently installed VMs * @throws CoreException if trying to compute the XML for the VM state encounters a problem */ private static String getVMsAsXML() throws CoreException { VMDefinitionsContainer container = new VMDefinitionsContainer(); container.setDefaultVMInstallCompositeID(getDefaultVMId()); container.setDefaultVMInstallConnectorTypeID(getDefaultVMConnectorId()); IVMInstallType[] vmTypes = getVMInstallTypes(); IVMInstall[] vms = null; for (int i = 0; i < vmTypes.length; ++i) { vms = vmTypes[i].getVMInstalls(); for (int j = 0; j < vms.length; j++) { container.addVM(vms[j]); } } return container.getAsXML(); }
/** * Returns the listing of currently installed VMs as a single XML file * @return an XML representation of all of the currently installed VMs * @throws CoreException if trying to compute the XML for the VM state encounters a problem */ private static String getVMsAsXML() throws CoreException { VMDefinitionsContainer container = new VMDefinitionsContainer(); container.setDefaultVMInstallCompositeID(getDefaultVMId()); container.setDefaultVMInstallConnectorTypeID(getDefaultVMConnectorId()); IVMInstallType[] vmTypes = getVMInstallTypes(); IVMInstall[] vms = null; for (int i = 0; i < vmTypes.length; ++i) { vms = vmTypes[i].getVMInstalls(); for (int j = 0; j < vms.length; j++) { container.addVM(vms[j]); } } return container.getAsXML(); }