当前位置: 首页>>代码示例>>Java>>正文


Java IVMInstallType.getVMInstalls方法代码示例

本文整理汇总了Java中org.eclipse.jdt.launching.IVMInstallType.getVMInstalls方法的典型用法代码示例。如果您正苦于以下问题:Java IVMInstallType.getVMInstalls方法的具体用法?Java IVMInstallType.getVMInstalls怎么用?Java IVMInstallType.getVMInstalls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.launching.IVMInstallType的用法示例。


在下文中一共展示了IVMInstallType.getVMInstalls方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setAllVMs

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
/**
 * This method will fetch and set All Available JVMs in Dropdown
 */
private void setAllVMs() {
    final List<IVMInstall> allVMs = new ArrayList<>();
    final IVMInstallType[] vmTypes = JavaRuntime.getVMInstallTypes();
    for (final IVMInstallType vmType : vmTypes) {
        final IVMInstall[] vms = vmType.getVMInstalls();
        for (final IVMInstall vm : vms) {
            allVMs.add(vm);
        }
    }
    this.jvmNamesAndValues = new String[allVMs.size()][2];
    for (int i = 0; i < allVMs.size(); i++) {
        this.jvmNamesAndValues[i][0] = allVMs.get(i).getName();
        this.jvmNamesAndValues[i][1] = allVMs.get(i).getId();
    }
}
 
开发者ID:rajendarreddyj,项目名称:eclipse-weblogic-plugin,代码行数:19,代码来源:JVMOptionsPreferencePage.java

示例2: getVMInstall

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
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;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:19,代码来源:CloudFoundryServerRuntime.java

示例3: eclipseAndJvmSupportedJavaVersion

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
/** TopCoder supports java 1.8. */
private static String eclipseAndJvmSupportedJavaVersion() {
  boolean jvm18Installed = false;
  for(IVMInstallType vm : JavaRuntime.getVMInstallTypes()) {
    for(IVMInstall inst : vm.getVMInstalls()) {
      if(inst instanceof IVMInstall2) {
        String jvmVersion = ((IVMInstall2) inst).getJavaVersion();
        String[] jvmVersionParts  = jvmVersion.split("\\.");
        int major = Integer.parseInt(jvmVersionParts[0]);
        int minor = Integer.parseInt(jvmVersionParts[1]);
        if((major == 1 && minor >= 8) || major >=2) {
          jvm18Installed = true;
        }
      }
    }
  }

  Version jdtVersion = JavaCore.getJavaCore().getBundle().getVersion();
  boolean jdtSupports18 = jdtVersion.getMajor() >= 4
      || (jdtVersion.getMajor() == 3 && jdtVersion.getMinor() >= 10)
      || (jdtVersion.getMajor() == 3 && jdtVersion.getMinor() >= 9 && jdtVersion.getMicro() >= 50);

  return jvm18Installed && jdtSupports18 ? "1.8" : "1.7";
}
 
开发者ID:fmoraes74,项目名称:eclipseforces,代码行数:25,代码来源:JavaLanguageSupport.java

示例4: processVMInstallType

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
private void processVMInstallType(IVMInstallType installType, List locations, List labels) {
	if (installType != null) {
		IVMInstall[] installs= installType.getVMInstalls();
		boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS());
		final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$
		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 {
				String filePath= installs[i].getInstallLocation().getAbsolutePath();
				// on MacOS X install locations end in an additional "/Home" segment; remove it
				if (isMac && filePath.endsWith(HOME_SUFFIX))
					filePath= filePath.substring(0, filePath.length()- HOME_SUFFIX.length() + 1);
				locations.add(filePath);
				labels.add(label);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:TypeInfoViewer.java

示例5: processVMInstallType

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
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);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:FilteredTypesSelectionDialog.java

示例6: getVMInstall

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
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)
    {
        JettyPlugin.log(e);
    }
    
    return null;
}
 
开发者ID:bengalaviz,项目名称:JettyWTPPlugin,代码行数:24,代码来源:JettyRuntime.java

示例7: processVMInstallType

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
private void processVMInstallType(IVMInstallType installType, List<String> locations, List<String> labels) {
	if (installType != null) {
		IVMInstall[] installs= installType.getVMInstalls();
		boolean isMac= Platform.OS_MACOSX.equals(Platform.getOS());
		final String HOME_SUFFIX= "/Home"; //$NON-NLS-1$
		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 {
				String filePath= installs[i].getInstallLocation().getAbsolutePath();
				// on MacOS X install locations end in an additional
				// "/Home" segment; remove it
				if (isMac && filePath.endsWith(HOME_SUFFIX))
					filePath= filePath.substring(0, filePath.length() - HOME_SUFFIX.length() + 1);
				locations.add(filePath);
				labels.add(label);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:23,代码来源:FilteredTypesSelectionDialog.java

示例8: getVMInstall

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
/**
 * 
 * @return
 */
public IVMInstall getVMInstall() {
    final IVMInstallType[] vmTypes = JavaRuntime.getVMInstallTypes();
    for (final IVMInstallType vmType : vmTypes) {
        final IVMInstall[] vms = vmType.getVMInstalls();
        for (final IVMInstall vm : vms) {
            if (vm.getId().equals(WeblogicPlugin.getDefault().getJRE())) {
                return vm;
            }
        }
    }
    return JavaRuntime.getDefaultVMInstall();
}
 
开发者ID:rajendarreddyj,项目名称:eclipse-weblogic-plugin,代码行数:17,代码来源:WeblogicLauncher.java

示例9: findVM

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
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;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:JDTLanguageServer.java

示例10: testDefaultVM

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
@Test
public void testDefaultVM() throws CoreException {
	String oldJavaHome = prefManager.getPreferences().getJavaHome();
	IVMInstall oldVm = JavaRuntime.getDefaultVMInstall();
	assertNotNull(oldVm);
	try {
		IVMInstall vm = null;
		IVMInstallType type = JavaRuntime.getVMInstallType(TestVMType.VMTYPE_ID);
		IVMInstall[] installs = type.getVMInstalls();
		for (IVMInstall install : installs) {
			if (!install.equals(oldVm)) {
				vm = install;
				break;
			}
		}
		assertNotNull(vm);
		assertNotEquals(vm, oldVm);
		String javaHome = new File(TestVMType.getFakeJDKsLocation(), "9").getAbsolutePath();
		prefManager.getPreferences().setJavaHome(javaHome);
		boolean changed = server.configureVM();
		IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
		assertTrue("A VM hasn't been changed", changed);
		assertEquals(vm, defaultVM);
		assertNotEquals(oldVm, defaultVM);
	} finally {
		prefManager.getPreferences().setJavaHome(oldJavaHome);
		TestVMType.setTestJREAsDefault();
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:30,代码来源:JDTLanguageServerTest.java

示例11: findJre

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
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;
}
 
开发者ID:diffplug,项目名称:goomph,代码行数:13,代码来源:InstalledJreAdderInternal.java

示例12: enforcePreferredCompilerCompliance

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
/**
 * Makes the given project use JDK 6 (or more specifically,
 * {@link AdtConstants#COMPILER_COMPLIANCE_PREFERRED} as the compilation
 * target, regardless of what the default IDE JDK level is, provided a JRE
 * of the given level is installed.
 *
 * @param javaProject the Java project
 * @throws CoreException if the IDE throws an exception setting the compiler
 *             level
 */
@SuppressWarnings("restriction") // JDT API for setting compliance options
public static void enforcePreferredCompilerCompliance(IJavaProject javaProject)
        throws CoreException {
    String compliance = javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
    if (compliance == null ||
            JavaModelUtil.isVersionLessThan(compliance, COMPILER_COMPLIANCE_PREFERRED)) {
        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];
                if (install instanceof IVMInstall2) {
                    IVMInstall2 install2 = (IVMInstall2) install;
                    // Java version can be 1.6.0, and preferred is 1.6
                    if (install2.getJavaVersion().startsWith(COMPILER_COMPLIANCE_PREFERRED)) {
                        Map<String, String> options = javaProject.getOptions(false);
                        JavaCore.setComplianceOptions(COMPILER_COMPLIANCE_PREFERRED, options);
                        JavaModelUtil.setDefaultClassfileOptions(options,
                                COMPILER_COMPLIANCE_PREFERRED);
                        javaProject.setOptions(options);
                        return;
                    }
                }
            }
        }
    }
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:39,代码来源:ProjectHelper.java

示例13: getWorkspaceJREs

import org.eclipse.jdt.launching.IVMInstallType; //导入方法依赖的package包/类
private IVMInstall[] getWorkspaceJREs() {
	List<VMStandin> standins = new ArrayList<VMStandin>();
	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()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:NewJavaProjectWizardPageOne.java


注:本文中的org.eclipse.jdt.launching.IVMInstallType.getVMInstalls方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。