可通过多个模块访问软件包:< unnamed> [英] Package accessible from more than one module: <unnamed>
本文介绍了可通过多个模块访问软件包:< unnamed>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在JMX控制台中注册MBean时,出现以下错误消息:
When trying to register an MBean in JMX Console I'm getting the following error message:
The package javax.management is accessible from more than one module: <unnamed>, java.management
我正在使用Eclipse,并且我的项目结构中没有module-info.java
文件.
I'm using Eclipse and I have no module-info.java
file in my project structure.
当我注释对Java EE API的依赖关系时,错误消失了,但是javax.management
包不是JAR的一部分.
The error disappear when I comment my dependency for Java EE API, but the javax.management
package is not part of the JAR.
推荐答案
从Java 8更新到Java 11时,我遇到了类似的问题.
I experienced similar issue when updating from java 8 to java 11. Steps below helped me,
- 右键单击Eclipse项目>属性">"Java构建路径"
- 在库标签中,删除 Modulepath 下的所有外部jar文件,并在 Classpath 下添加它们(您可以选择所有jar和将它们拖到 Classpath ) 下
- 点击应用并关闭
- Right click Eclipse project > Properties > Java Build Path
- In Libraries tab, remove all the external jar files under Modulepath and add them under Classpath (you can just select all the jars and drag them under Classpath)
- Click Apply and Close
注意:JRE系统库将保留在 Modulepath 下.
Note: JRE System Library will remain under Modulepath.
Eclipse版本:2019-09
Eclipse version: 2019-09
这篇关于可通过多个模块访问软件包:< unnamed>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文