RuntimeException: jdk.internal.jimage.decompressor package in jrt.fs module and java.base module

Component details - using IntelliJ IDEA 2017.1 CE and jdk-9-ea + 154

main () -

Set<String> set2 = Set.of("a", "b", "c"); set2.forEach(System.out::println); 

module-info.java

 module collection { requires java.base; } 

Magazines -

 Error occurred during initialization of VM java.lang.RuntimeException: Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.base at jdk.internal.module.ModuleBootstrap.fail( java.base@9-ea /ModuleBootstrap.java:699) at jdk.internal.module.ModuleBootstrap.boot( java.base@9-ea /ModuleBootstrap.java:329) at java.lang.System.initPhase2( java.base@9-ea /System.java:1928) 

I doubt the implementation of VM initialization, my question is that I did not include the jrt.fs module - where does it come from in the picture? How to debug inclusion / exclusion of such modules? How can I resolve the current exception more?

+7
source share
3 answers

$ JAVA_HOME / lib / jrt-fs.jar contains a copy of the "jrt" file system provider compiled in JDK 8. It is intended for tools such as IDEs that run on JDK 8, but to access JDK 9 a run-time image.

From this exception, it appears that this JAR file, or possibly $ JAVA_HOME / lib, was put into the module path by mistake. JAR files that do not contain module-info.class in the top-level directory are treated as automatic modules, which is why the message contains the message "module jrt.fs". The exception basically means that you are finished with two modules containing the jdk.internal.jimage.decompressor package (and many other packages) due to the placement of jrt-fs.jar in the module path.

+5
source

Try removing jrt-fs.jar from the jdk9 directory. I did this in Project Structure in IntelliJ IDEA and it works great for me.

+2
source

I had the same problem with Manjaro Linux while it worked fine on Windows. After examining the differences, it became clear that the javafx 11 package is installed in / lib / jvm / java-11-openjdk / lib, which I then installed as PATH_TO_FX. This seems to be a problem because jrt-fs.jar is in the same folder.

I moved all the files from fx to a separate folder and then set this as PATH_TO_FX. Now it works fine.

+2
source

Source: https://habr.com/ru/post/1265846/


All Articles