IDEA-135970 (adjusted path included in JDK validation)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Mon, 16 Feb 2015 22:28:12 +0000 (23:28 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Mon, 16 Feb 2015 22:28:12 +0000 (23:28 +0100)
java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java

index dbc4330202a8aef55d32dbe5a26314772ba3bad0..4ee28ed0cbe37e9c404aebdc4d14e479bcdf4b54 100644 (file)
@@ -241,8 +241,11 @@ public class JavaSdkImpl extends JavaSdk {
     final FileChooserDescriptor descriptor = new FileChooserDescriptor(baseDescriptor) {
       @Override
       public void validateSelectedFiles(VirtualFile[] files) throws Exception {
     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);
       }
         }
         baseDescriptor.validateSelectedFiles(files);
       }