From 80fd1723c314174212a74a6a75858b65c73fc7a3 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 16 Feb 2015 23:28:12 +0100 Subject: [PATCH] IDEA-135970 (adjusted path included in JDK validation) --- .../intellij/openapi/projectRoots/impl/JavaSdkImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java index dbc4330202a8..4ee28ed0cbe3 100644 --- a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java @@ -241,8 +241,11 @@ public class JavaSdkImpl extends JavaSdk { final FileChooserDescriptor descriptor = new FileChooserDescriptor(baseDescriptor) { @Override public void validateSelectedFiles(VirtualFile[] files) throws Exception { - if (files.length > 0 && JrtFileSystem.isModularJdk(files[0].getPath()) && !JrtFileSystem.isSupported()) { - throw new Exception(LangBundle.message("jrt.not.available.message")); + if (files.length > 0 && !JrtFileSystem.isSupported()) { + String path = files[0].getPath(); + if (JrtFileSystem.isModularJdk(path) || JrtFileSystem.isModularJdk(adjustSelectedSdkHome(path))) { + throw new Exception(LangBundle.message("jrt.not.available.message")); + } } baseDescriptor.validateSelectedFiles(files); } -- 2.32.0