Package com.intellij.openapi.projectRoots

Examples of com.intellij.openapi.projectRoots.ProjectJdk


  public static ProjectJdk[] getUsedJdks(Project project) {
    final Set<ProjectJdk> jdks = new HashSet<ProjectJdk>();
    Module[] modules = ModuleManager.getInstance(project).getModules();
    for (Module module : modules) {
      ProjectJdk jdk = ModuleRootManager.getInstance(module).getJdk();
      if (jdk != null) {
        jdks.add(jdk);
      }
    }
    return jdks.toArray(new ProjectJdk[jdks.size()]);
View Full Code Here


      contentEntry.addSourceFolder(ext_src, false);
    }

    // IMPORTANT! The jdk must be obtained in a way it is obtained in the normal program!
    //ProjectJdkEx jdk = ProjectJdkTable.getInstance().getInternalJdk();
    ProjectJdk jdk;
    if ("java 1.5".equals(jdkName)) {
      jdk = JavaSdkImpl.getMockJdk15(jdkName);
      myPsiManager.setEffectiveLanguageLevel(LanguageLevel.JDK_1_5);
    }
    else {
View Full Code Here

  public @Nullable ProjectJdk getJdk() {
    return myJdk;
  }

  public String getJdkPath() throws CantRunException {
    final ProjectJdk jdk = getJdk();
    if(jdk == null) {
      throw new CantRunException(ExecutionBundle.message("no.jdk.specified..error.message"));
    }

    final String jdkHome = jdk.getHomeDirectory().getPresentableUrl();
    if(jdkHome == null || jdkHome.length() == 0) {
      throw new CantRunException(ExecutionBundle.message("home.directory.not.specified.for.jdk.error.message"));
    }
    return jdkHome;
  }
View Full Code Here

  public void configureByModule(final Module module, final int classPathType) throws CantRunException {
    configureByModule(module, classPathType, getModuleJdk(module));
  }

  public static ProjectJdk getModuleJdk(final Module module) throws CantRunException {
    final ProjectJdk jdk = ModuleRootManager.getInstance(module).getJdk();
    if (jdk == null) {
      throw CantRunException.noJdkForModule(module);
    }
    final VirtualFile homeDirectory = jdk.getHomeDirectory();
    if (homeDirectory == null || !homeDirectory.isValid()) {
      throw CantRunException.jdkMisconfigured(jdk, module);
    }
    return jdk;
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.projectRoots.ProjectJdk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.