use of com.intellij.openapi.projectRoots.JavaSdkVersion in project moe-ide-integration by multi-os-engine.
the class MOESdkType method getJDK.
public static Sdk getJDK() {
Sdk sdk = null;
for (Sdk jdk : ProjectJdkTable.getInstance().getAllJdks()) {
if (jdk != null && jdk.getSdkType() instanceof JavaSdk) {
if (sdk == null) {
sdk = jdk;
} else {
JavaSdkVersion version = ((JavaSdk) jdk.getSdkType()).getVersion(jdk);
JavaSdkVersion desiredVersion = ((JavaSdk) sdk.getSdkType()).getVersion(sdk);
if (version != null && desiredVersion != null && version.isAtLeast(desiredVersion)) {
sdk = jdk;
}
}
}
}
return sdk;
}
use of com.intellij.openapi.projectRoots.JavaSdkVersion in project intellij by bazelbuild.
the class Jdks method getVersion.
private static JavaSdkVersion getVersion(String jdkRoot) {
String version = JavaSdk.getInstance().getVersionString(jdkRoot);
if (version == null) {
return JavaSdkVersion.JDK_1_0;
}
JavaSdkVersion sdkVersion = JavaSdk.getInstance().getVersion(version);
return sdkVersion == null ? JavaSdkVersion.JDK_1_0 : sdkVersion;
}
Aggregations