RuntimeException:在模块jrt.fs和模块java.base中打包jdk.internal.jimage.decompressor [英] RuntimeException: Package jdk.internal.jimage.decompressor in module jrt.fs and module java.base

查看:5203
本文介绍了RuntimeException:在模块jrt.fs和模块java.base中打包jdk.internal.jimage.decompressor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

组件详细信息 - 使用 IntelliJ IDEA 2017.1 CE 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;
}

日志 -

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)

对于初始化VM 的实施非常怀疑,我的问题是我没有包含模块 jrt。 fs - 图片来自哪里?如何调试此类模块包含/排除?如何进一步解决当前异常?

Doubtful over the implementation of initialization of VM, my question is that I haven't included module jrt.fs - Where is it coming in the picture from? How do I debug such modules inclusion/exclusion? How do I further solve the current exception?

推荐答案

$ JAVA_HOME / lib / jrt-fs.jar包含 jrt文件系统提供程序编译为JDK 8.它适用于在JDK 8上运行但需要访问JDK 9运行时映像的IDE等工具。

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

来自异常然后看起来这个JAR文件,或者可能是$ JAVA_HOME / lib,已经错误地放在模块路径上。在顶级目录中不包含module-info.class的JAR文件被视为自动模块,因此这就是消息中异常具有module jrt.fs的原因。异常基本上只是意味着你最终得到了两个包含jdk.internal.jimage.decompressor包(以及许多其他包)的模块,因为在模块路径上放了jrt-fs.jar。

From the exception then it does appear that this JAR file, or maybe $JAVA_HOME/lib, has been put on the module path in error. JAR files that do no contain a module-info.class in the top-level directory are treated as automatic modules so this is why the exception has "module jrt.fs" in the message. The exception basically just means that you've ended up with two modules containing the jdk.internal.jimage.decompressor package (and many other packages) due to putting jrt-fs.jar on the module path.

这篇关于RuntimeException:在模块jrt.fs和模块java.base中打包jdk.internal.jimage.decompressor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆