mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java: fix computation of path to jdkAnnotation for case when Java support is installed as a plugin (IDEA-195719)
This commit is contained in:
@@ -272,9 +272,19 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
pathsChecked.add(path);
|
||||
|
||||
if (root == null) { // build
|
||||
String url = "jar://" + FileUtil.toSystemIndependentName(PathManager.getHomePath()) + "/lib/jdkAnnotations.jar!/";
|
||||
root = VirtualFileManager.getInstance().findFileByUrl(url);
|
||||
pathsChecked.add(FileUtil.toSystemIndependentName(PathManager.getHomePath()) + "/lib/jdkAnnotations.jar");
|
||||
String javaPluginClassesRootPath = PathManager.getJarPathForClass(JavaSdkImpl.class);
|
||||
LOG.assertTrue(javaPluginClassesRootPath != null);
|
||||
File javaPluginClassesRoot = new File(javaPluginClassesRootPath);
|
||||
if (javaPluginClassesRoot.isFile()) {
|
||||
String annotationsJarPath = FileUtil.toSystemIndependentName(new File(javaPluginClassesRoot.getParentFile(), "jdkAnnotations.jar").getAbsolutePath());
|
||||
root = VirtualFileManager.getInstance().findFileByUrl("jar://" + annotationsJarPath + "!/");
|
||||
pathsChecked.add(annotationsJarPath);
|
||||
}
|
||||
if (root == null) {
|
||||
String url = "jar://" + FileUtil.toSystemIndependentName(PathManager.getHomePath()) + "/lib/jdkAnnotations.jar!/";
|
||||
root = VirtualFileManager.getInstance().findFileByUrl(url);
|
||||
pathsChecked.add(FileUtil.toSystemIndependentName(PathManager.getHomePath()) + "/lib/jdkAnnotations.jar");
|
||||
}
|
||||
}
|
||||
|
||||
if (root == null) {
|
||||
|
||||
Reference in New Issue
Block a user