Error at jrt*.js

Yasumasa Suenaga yasuenag at
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( at 9-ea/
         at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2( at 9-ea/
         at at 9-ea/
Caused by: java.lang.NullPointerException
         at java.util.Objects.requireNonNull(java.base at 9-ea/
         at jdk.internal.jrtfs.JrtFileSystemProvider.newFileSystem(java.base at 9-ea/
         at java.nio.file.FileSystems.newFileSystem(java.base at 9-ea/
         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( at 9-ea/
         at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12( at 9-ea/
         at com.sun.javafx.application.PlatformImpl.lambda$runLater$10( at 9-ea/
         at at 9-ea/Native Method)
         at com.sun.javafx.application.PlatformImpl.lambda$runLater$11( at 9-ea/
         at$ at 9-ea/
         at at 9-ea/Native Method)
         at$runLoop$3( at 9-ea/
         ... 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("");
+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?");
-        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?



More information about the core-libs-dev mailing list