java的jrt,RuntimeException:在模块jrt.fs和模块java.base中打包jdk.internal.jimage.decompressor...

Component Details - Using IntelliJ IDEA 2017.1 CE and jdk-9-ea+154

main() -

Set set2 = Set.of("a", "b", "c");

set2.forEach(System.out::println);

module-info.java

module collection {

requires java.base;

}

Logs -

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)

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 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.

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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值