use of com.intellij.util.JdkBundleList in project intellij-community by JetBrains.
the class SwitchBootJdkAction method findJdkPaths.
@NotNull
public static JdkBundleList findJdkPaths() {
JdkBundle bootJdk = JdkBundle.createBoot();
JdkBundleList jdkBundleList = new JdkBundleList();
if (bootJdk != null) {
jdkBundleList.addBundle(bootJdk, true);
}
if (new File(PathManager.getHomePath() + File.separator + bundledJdkFile).exists()) {
JdkBundle bundledJdk = JdkBundle.createBundle(bundledJdkFile, false, true);
if (bundledJdk != null) {
jdkBundleList.addBundle(bundledJdk, true);
}
}
if (SystemInfo.isMac) {
jdkBundleList.addBundlesFromLocation(STANDARD_JDK_LOCATION_ON_MAC_OS_X, JDK8_VERSION, null);
} else if (SystemInfo.isLinux) {
for (String location : STANDARD_JVM_LOCATIONS_ON_LINUX) {
jdkBundleList.addBundlesFromLocation(location, JDK8_VERSION, null);
}
} else if (SystemInfo.isWindows) {
for (File root : File.listRoots()) {
if (SystemInfo.is32Bit) {
jdkBundleList.addBundlesFromLocation(new File(root, STANDARD_JVM_X86_LOCATIONS_ON_WINDOWS).getAbsolutePath(), JDK8_VERSION, null);
} else {
jdkBundleList.addBundlesFromLocation(new File(root, STANDARD_JVM_X64_LOCATIONS_ON_WINDOWS).getAbsolutePath(), JDK8_VERSION, null);
}
}
}
return jdkBundleList;
}
Aggregations