本文整理匯總了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");
}
}