mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-168924 JDK switcher does not show bundled jdk
Handled new bundled jdk structure
This commit is contained in:
@@ -204,8 +204,11 @@ public class JdkBundle {
|
||||
|
||||
private static Pair<Pair<String, Boolean>, Pair<Version, Integer>> getJDKNameArchVersionAndUpdate(File jvm, String homeSubPath) {
|
||||
GeneralCommandLine commandLine = new GeneralCommandLine().withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.NONE);
|
||||
commandLine.setExePath(new File(jvm, homeSubPath + File.separator + "jre" +
|
||||
File.separator + "bin" + File.separator + "java").getAbsolutePath());
|
||||
File jvmPath = new File(jvm, homeSubPath + File.separator + "jre" + File.separator + "bin" + File.separator + "java");
|
||||
if (!jvmPath.exists()) {
|
||||
jvmPath = new File(jvm, homeSubPath + File.separator + "bin" + File.separator + "java");
|
||||
}
|
||||
commandLine.setExePath(jvmPath.getAbsolutePath());
|
||||
commandLine.addParameter("-version");
|
||||
|
||||
String displayVersion;
|
||||
|
||||
@@ -113,10 +113,7 @@ public class JdkBundleTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateBundle() throws Exception {
|
||||
File homeJDK = new File(System.getProperty("java.home")).getParentFile();
|
||||
|
||||
public void doTestCreateBundle(File homeJDK) throws Exception {
|
||||
if (!new File(homeJDK, "lib/tools.jar").exists()) return; // Skip pure jre
|
||||
|
||||
File bootJDK = SystemInfo.isMac ? homeJDK.getParentFile().getParentFile() : homeJDK;
|
||||
@@ -141,6 +138,15 @@ public class JdkBundleTest {
|
||||
assertTrue(evalVerStr + " is not the same with " + verStr, verStr.contains(evalVerStr));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateBundle() throws Exception {
|
||||
File home = new File(System.getProperty("java.home"));
|
||||
|
||||
doTestCreateBundle(home);
|
||||
|
||||
doTestCreateBundle(home.getParentFile());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateBoot() throws Exception {
|
||||
File homeJDK = new File(System.getProperty("java.home")).getParentFile();
|
||||
|
||||
Reference in New Issue
Block a user