Commit 3899427
committed
Improve support for Java 9+
This avoids the hardcoded message to stderr:
[ERROR]: Cannot locate JRE jar in /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
And subsequent exception:
java.lang.IllegalArgumentException: info cannot be null
at org.fife.rsta.ac.java.JarManager.addClassFileSource(JarManager.java:157)
at org.fife.rsta.ac.java.JarManager.addCurrentJreClassFileSource(JarManager.java:193)
at org.scijava.ui.swing.script.languagesupport.JavaLanguageSupportPlugin.<init>(JavaLanguageSupportPlugin.java:56)
Which happens because the LibraryInfo.getJreJarInfo(File) method fails
to locate the main JRE JAR file, because Java 9+ does not have one --
rather, core classes are divided into modules in the jmods folder.
And allows the plugin to be created successfully anyway.
Fixes #29.
It also makes a best effort to find the "main JRE JAR" -- which for the
moment we point at jmods/java.base.jmod, one of many core modules --
and the sources archive in its new location, which is lib/src.zip.
Unfortunately, this logic is still insufficient to actually allow
RSyntaxTextArea's language support to display javadoc for core Java
classes with Java 9+, because the src.zip's internal directory structure
is now divided by module, which the library does not yet understand.
So really, an upstream fix will be needed to address this. Someday.1 parent e83b2f7 commit 3899427
File tree
1 file changed
+44
-3
lines changed- src/main/java/org/scijava/ui/swing/script/languagesupport
1 file changed
+44
-3
lines changedLines changed: 44 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
64 | 105 | | |
0 commit comments