com.intellij.openapi.projectRoots.JdkUtil Java Examples

The following examples show how to use com.intellij.openapi.projectRoots.JdkUtil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XQueryRunProfileState.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
private Sdk createAlternativeJdk(@NotNull String jreHome) throws CantRunException {
    final Sdk configuredJdk = ProjectJdkTable.getInstance().findJdk(jreHome);
    if (configuredJdk != null) {
        return configuredJdk;
    }

    if (!JdkUtil.checkForJre(jreHome) && !JdkUtil.checkForJdk(jreHome)) {
        throw new CantRunException(ExecutionBundle.message("jre.path.is.not.valid.jre.home.error.message", jreHome));
    }

    final String versionString = SdkVersionUtil.detectJdkVersion(jreHome);
    final Sdk jdk = new SimpleJavaSdkType().createJdk(versionString != null ? versionString : "", jreHome);
    if (jdk == null) throw CantRunException.noJdkConfigured();
    return jdk;
}
 
Example #2
Source File: RemoteCommandLineBuilder.java    From embeddedlinux-jvmdebugger-intellij with Apache License 2.0 4 votes vote down vote up
public static GeneralCommandLine createFromJavaParameters(final SimpleJavaParameters javaParameters,
                                                          final Project project,
                                                          final boolean dynamicClasspath) throws CantRunException {
    return createFromJavaParameters(javaParameters, dynamicClasspath && JdkUtil.useDynamicClasspath(project));
}
 
Example #3
Source File: AlternativeJreValidator.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
public static void checkAlternativeJRE(@Nullable String jrePath) throws RuntimeConfigurationWarning {
    if (StringUtil.isEmpty(jrePath) ||
            ProjectJdkTable.getInstance().findJdk(jrePath) == null && !JdkUtil.checkForJre(jrePath)) {
        throw new RuntimeConfigurationWarning(ExecutionBundle.message("jre.path.is.not.valid.jre.home.error.message", jrePath));
    }
}
 
Example #4
Source File: XQueryRunProfileState.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
private GeneralCommandLine createFromJavaParameters(final SimpleJavaParameters javaParameters,
                                                    final Project project) throws CantRunException {
    return createFromJavaParameters(javaParameters, JdkUtil.useDynamicClasspath(project));
}