[java] anticipates jrt-fs.jar move

This commit is contained in:
Roman Shevchenko
2016-11-17 16:47:31 +01:00
parent 0f18327d65
commit 502f712fc6
2 changed files with 3 additions and 2 deletions
@@ -51,7 +51,8 @@ class JrtHandler extends ArchiveHandler {
fs = FileSystems.newFileSystem(ROOT_URI, Collections.singletonMap("java.home", path));
}
else {
File file = new File(path, "jrt-fs.jar");
File file = new File(path, "lib/jrt-fs.jar");
if (!file.exists()) file = new File(path, "jrt-fs.jar");
if (!file.exists()) throw new IOException("Missing provider: " + file);
URL url = file.toURI().toURL();
ClassLoader loader = new URLClassLoader(new URL[]{url}, null);
@@ -36,7 +36,7 @@ public abstract class JrtFileSystem extends ArchiveFileSystem {
}
public static boolean isModularJdk(@NotNull String homePath) {
return new File(homePath, "lib/modules").exists() && new File(homePath, "jrt-fs.jar").isFile();
return new File(homePath, "lib/jrt-fs.jar").isFile() || new File(homePath, "jrt-fs.jar").isFile();
}
public static boolean isRoot(@NotNull VirtualFile file) {