Error at jrt*.js
Yasumasa Suenaga
yasuenag at gmail.com
Thu Aug 18 14:21:05 UTC 2016
Hi all,
I tried to run jrtfsviewer.js and jrtls.js . But they did not work as below:
----------------
$ jjs -fx jrtfsviewer.js
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(javafx.graphics at 9-ea/LauncherImpl.java:897)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(javafx.graphics at 9-ea/LauncherImpl.java:188)
at java.lang.Thread.run(java.base at 9-ea/Thread.java:843)
Caused by: java.lang.NullPointerException
at java.util.Objects.requireNonNull(java.base at 9-ea/Objects.java:221)
at jdk.internal.jrtfs.JrtFileSystemProvider.newFileSystem(java.base at 9-ea/JrtFileSystemProvider.java:104)
at java.nio.file.FileSystems.newFileSystem(java.base at 9-ea/FileSystems.java:342)
at jdk.nashorn.internal.scripts.Script$Recompilation$22$3116$jrtfsviewer$cu1$restOf.getJrtFileSystem(jdk.scripting.nashorn.scripts/jrtfsviewer.js:103)
at jdk.nashorn.internal.scripts.Script$Recompilation$17$3748A$jrtfsviewer.start(jdk.scripting.nashorn.scripts/jrtfsviewer.js:109)
at jdk.nashorn.internal.scripts.Script$Recompilation$6$839A$\=fx\!bootstrap$cu1$restOf.start(jdk.scripting.nashorn.scripts/fx:bootstrap.js:57)
at jdk.nashorn.javaadapters.javafx_application_Application.start(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(javafx.graphics at 9-ea/LauncherImpl.java:843)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(javafx.graphics at 9-ea/PlatformImpl.java:452)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(javafx.graphics at 9-ea/PlatformImpl.java:421)
at java.security.AccessController.doPrivileged(java.base at 9-ea/Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(javafx.graphics at 9-ea/PlatformImpl.java:420)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(javafx.graphics at 9-ea/InvokeLaterDispatcher.java:96)
at com.sun.glass.ui.win.WinApplication._runLoop(javafx.graphics at 9-ea/Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(javafx.graphics at 9-ea/WinApplication.java:189)
... 1 more
----------------
$ jjs jrtls.js
jrtls.js:37:1 Expected an operand but found *
*/
^
----------------
These scripts are not in JDK. I guess they are used for checking JDK/JRE modules by JDK developers, and they are no longer used.
So I'm not sure whether they should be fixed.
I think they can be fixed as below:
----------------
diff -r b60dcba6b4f9 src/java.base/share/classes/jdk/internal/jrtfs/jrtfsviewer.js
--- a/src/java.base/share/classes/jdk/internal/jrtfs/jrtfsviewer.js Tue Aug 16 09:57:50 2016 +0200
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/jrtfsviewer.js Wed Aug 18 20:41:25 2016 +0900
@@ -53,6 +53,7 @@
var Files = Java.type("java.nio.file.Files");
var System = Java.type("java.lang.System");
var URI = Java.type("java.net.URI");
+var Collections = Java.type("java.util.Collections");
// JavaFX classes used
var StackPane = Java.type("javafx.scene.layout.StackPane");
@@ -100,7 +101,7 @@
print("did you miss specifying jrt-fs.jar with -cp option?");
usage();
}
- return FileSystems.newFileSystem(uri, null, cls.classLoader);
+ return FileSystems.newFileSystem(uri, Collections.emptyMap(), cls.classLoader);
}
}
diff -r b60dcba6b4f9 src/java.base/share/classes/jdk/internal/jrtfs/jrtls.js
--- a/src/java.base/share/classes/jdk/internal/jrtfs/jrtls.js Tue Aug 16 09:57:50 2016 +0200
+++ b/src/java.base/share/classes/jdk/internal/jrtfs/jrtls.js Wed Aug 18 20:41:25 2016 +0900
@@ -34,7 +34,6 @@
* but also compiled and delivered as part of the jrtfs.jar to support access
* to the jimage file provided by the shipped JDK by tools running on JDK 8.
*/
- */
// classes used
var Files = Java.type("java.nio.file.Files");
----------------
If this fix should be merged, I'll file it to JBS and upload webrev.
What do you think about it?
Thanks,
Yasumasa
More information about the core-libs-dev
mailing list