本文整理汇总了Java中com.intellij.compiler.impl.javaCompiler.ModuleChunk.getJdk方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleChunk.getJdk方法的具体用法?Java ModuleChunk.getJdk怎么用?Java ModuleChunk.getJdk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.compiler.impl.javaCompiler.ModuleChunk
的用法示例。
在下文中一共展示了ModuleChunk.getJdk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJdkForStartupCommand
import com.intellij.compiler.impl.javaCompiler.ModuleChunk; //导入方法依赖的package包/类
private Sdk getJdkForStartupCommand(final ModuleChunk chunk) {
final Sdk jdk = chunk.getJdk();
if (ApplicationManager.getApplication().isUnitTestMode() && JavacConfiguration.getOptions(myProject, JavacConfiguration.class).isTestsUseExternalCompiler()) {
final String jdkHomePath = CompilerConfigurationImpl.getTestsExternalCompilerHome();
if (jdkHomePath == null) {
throw new IllegalArgumentException("[TEST-MODE] Cannot determine home directory for JDK to use javac from");
}
// when running under Mock JDK use VM executable from the JDK on which the tests run
return new MockJdkWrapper(jdkHomePath, jdk);
}
return jdk;
}
示例2: setupSourceVersion
import com.intellij.compiler.impl.javaCompiler.ModuleChunk; //导入方法依赖的package包/类
@SuppressWarnings({"HardCodedStringLiteral"})
private static void setupSourceVersion(final ModuleChunk chunk, final ArrayList<String> commandLine) {
final Sdk jdk = chunk.getJdk();
final String versionString = jdk.getVersionString();
final LanguageLevel applicableLanguageLevel = CompilerUtil.getApplicableLanguageLevel(versionString, chunk.getLanguageLevel());
if (applicableLanguageLevel.equals(LanguageLevel.JDK_1_5)) {
commandLine.add("-source");
commandLine.add("1.4"); // -source 1.5 not supported yet by jikes, so use the highest possible version
}
else if (applicableLanguageLevel.equals(LanguageLevel.JDK_1_4)) {
commandLine.add("-source");
commandLine.add("1.4");
}
}