/** * Returns the VM install type specified by the given launch configuration, * or <code>null</code> if none. * * @param configuration * launch configuration * @return the VM install type specified by the given launch configuration, * or <code>null</code> if none * @exception CoreException * if unable to retrieve the attribute */ public IVMInstallType getVMInstallType(ILaunchConfiguration configuration) throws CoreException { String id = getVMInstallTypeId(configuration); if (id != null) { IVMInstallType type = JavaRuntime.getVMInstallType(id); if (type != null) { return type; } } return null; } /**
setError(JREMessages.JREsComboBlock_8); } else { IVMInstallType installType = JavaRuntime.getVMInstallType(installTypeId); if (installType == null) { setError(MessageFormat.format(JREMessages.JREsComboBlock_9, new String[]{installTypeId}));
/** * Returns the VM install type specified by the given launch configuration, * or <code>null</code> if none. * * @param configuration * launch configuration * @return the VM install type specified by the given launch configuration, * or <code>null</code> if none * @exception CoreException * if unable to retrieve the attribute */ public IVMInstallType getVMInstallType(ILaunchConfiguration configuration) throws CoreException { String id = getVMInstallTypeId(configuration); if (id != null) { IVMInstallType type = JavaRuntime.getVMInstallType(id); if (type != null) { return type; } } return null; } /**
IVMInstallType vmType= JavaRuntime.getVMInstallType(id); if (vmType != null) {
IVMInstallType vmType= JavaRuntime.getVMInstallType(id); if (vmType != null) {
public boolean configureVM() throws CoreException { String javaHome = preferenceManager.getPreferences().getJavaHome(); if (javaHome != null) { File jvmHome = new File(javaHome); if (jvmHome.isDirectory()) { IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall(); File location = defaultVM.getInstallLocation(); if (!location.equals(jvmHome)) { IVMInstall vm = findVM(jvmHome); if (vm == null) { IVMInstallType installType = JavaRuntime.getVMInstallType(StandardVMType.ID_STANDARD_VM_TYPE); long unique = System.currentTimeMillis(); while (installType.findVMInstall(String.valueOf(unique)) != null) { unique++; } String vmId = String.valueOf(unique); VMStandin vmStandin = new VMStandin(installType, vmId); String name = StringUtils.defaultIfBlank(jvmHome.getName(), "JRE"); vmStandin.setName(name); vmStandin.setInstallLocation(jvmHome); vm = vmStandin.convertToRealVM(); } JavaRuntime.setDefaultVMInstall(vm, new NullProgressMonitor()); JDTUtils.setCompatibleVMs(vm.getId()); return true; } } } return false; }
private static IVMInstall registerNewVM(String name, File location) { // use the 'Standard VM' type to register a new VM IVMInstallType installType = JavaRuntime.getVMInstallType(StandardVMType.ID_STANDARD_VM_TYPE); // both the id and the name have to be unique for the registration String vmId = generateUniqueVMId(installType); // create the VM without firing events on individual method calls VMStandin vm = new VMStandin(installType, vmId); vm.setName(name); vm.setInstallLocation(location); return vm.convertToRealVM(); }
smonitor.setWorkRemaining(maps.length); List<VMStandin> jres= new ArrayList<>(); AbstractVMInstallType mactype = (AbstractVMInstallType) JavaRuntime.getVMInstallType("org.eclipse.jdt.internal.launching.macosx.MacOSXType"); //$NON-NLS-1$ if(mactype != null) { for (int i = 0; i < maps.length; i++) {
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; }
/** * Return the VM corresponding to the specified composite Id. The id uniquely * identifies a VM across all VM types. * * @param idString the composite id that specifies an instance of IVMInstall * @return the VM corresponding to the specified composite Id. * * @since 2.1 */ public static IVMInstall getVMFromCompositeId(String idString) { if (idString == null || idString.length() == 0) { return null; } CompositeId id= CompositeId.fromString(idString); if (id.getPartCount() == 2) { IVMInstallType vmType= getVMInstallType(id.get(0)); if (vmType != null) { return vmType.findVMInstall(id.get(1)); } } return null; }
smonitor.setWorkRemaining(maps.length); List<VMStandin> jres= new ArrayList<VMStandin>(); AbstractVMInstallType mactype = (AbstractVMInstallType) JavaRuntime.getVMInstallType("org.eclipse.jdt.internal.launching.macosx.MacOSXType"); //$NON-NLS-1$ if(mactype != null) { for (int i = 0; i < maps.length; i++) {
/** * Return the VM corresponding to the specified composite Id. The id uniquely * identifies a VM across all VM types. * * @param idString the composite id that specifies an instance of IVMInstall * @return the VM corresponding to the specified composite Id. * * @since 2.1 */ public static IVMInstall getVMFromCompositeId(String idString) { if (idString == null || idString.length() == 0) { return null; } CompositeId id= CompositeId.fromString(idString); if (id.getPartCount() == 2) { IVMInstallType vmType= getVMInstallType(id.get(0)); if (vmType != null) { return vmType.findVMInstall(id.get(1)); } } return null; }
IVMInstallType vt = getVMInstallType(type); if (vt == null) {
IVMInstallType vt = getVMInstallType(type); if (vt == 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; }
new String[]{element.getContributor().getName()}), null); IVMInstallType installType = getVMInstallType(vmType); if (installType == null) { abort(NLS.bind("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
IStatus status = EEVMType.validateDefinitionFile(description); if (status.isOK()) { VMStandin standin = new VMStandin(getVMInstallType(EEVMType.ID_EE_VM_TYPE), id); if (name != null && name.length() > 0){ standin.setName(name);
IStatus status = EEVMType.validateDefinitionFile(description); if (status.isOK()) { VMStandin standin = new VMStandin(getVMInstallType(EEVMType.ID_EE_VM_TYPE), id); if (name != null && name.length() > 0){ standin.setName(name);
String vmTypeId = getVMTypeId(containerPath); String vmName = getVMName(containerPath); IVMInstallType vmType = JavaRuntime.getVMInstallType(vmTypeId); if (vmType != null) { vm = vmType.findVMInstallByName(vmName);
String vmTypeId = getVMTypeId(containerPath); String vmName = getVMName(containerPath); IVMInstallType vmType = JavaRuntime.getVMInstallType(vmTypeId); if (vmType != null) { vm = vmType.findVMInstallByName(vmName);