diff --git a/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java b/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java index b42c549f9e73..dae6bdc222fb 100644 --- a/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java +++ b/java/java-impl/src/com/intellij/openapi/vfs/impl/jrt/JrtHandler.java @@ -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); diff --git a/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java b/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java index 2220c0612661..d3916e602634 100644 --- a/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java +++ b/java/openapi/src/com/intellij/openapi/vfs/jrt/JrtFileSystem.java @@ -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) {