简体   繁体   English

Eclipse模块问题JDK 10

[英]Eclipse module problems jdk 10

I'm having a new problem this morning with my project (it worked fine on Friday). 今天早上我的项目遇到了一个新问题(星期五工作得很好)。 Eclipse seems to be having trouble figuring out it's module / class path, and nothing I'm trying seems to affect it. Eclipse似乎很难弄清它的模块/类路径,而我尝试的任何事情似乎都不会影响它。 I'm using the following Eclipse configuration: 我正在使用以下Eclipse配置:

  • Version: 2019-03 M1 (4.11.0 M1) 版本:2019-03 M1(4.11.0 M1)
  • Build id: 20190117-2133 Build ID:20190117-2133
  • Oracle JDK 10.0.2 Oracle JDK 10.0.2

My project is a Java Maven multi-module (those are maven modules, not java modules) project, but does not define any java modules itself (we haven't converted it yet). 我的项目是Java Maven多模块(那些是maven模块,而不是Java模块)项目,但是没有定义任何Java模块本身(我们尚未对其进行转换)。 When attempting to compile it, eclipse throws up its hands and sends the message 尝试编译时,eclipse举起手并发送消息

"The package java.sql is accessible from more than one module: <unnamed>, java.sql". “可通过多个模块访问软件包java.sql:<未命名>,java.sql”。

While, on the surface, this seems helpful, I cannot find another module that defines the java.sql package, and the only instance of a class from the package (eg: java.sql.ResultSet) exists within the JDK system supplied library. 从表面上看,这似乎很有用,但是我找不到另一个定义java.sql包的模块,并且该包中类的唯一实例(例如:java.sql.ResultSet)存在于JDK系统提供的库中。 This also happens with the javax.xml package with the same error. 使用相同错误的javax.xml包也会发生这种情况。

I've attempted closing and re-opening eclipse, performing a clean, and a maven update project for everything, to no avail. 我试图关闭并重新打开Eclipse,对所有内容执行一个干净的Maven更新项目,但无济于事。 I've inspected the eclipse .log file, and there's nothing useful in there. 我已经检查了eclipse .log文件,并且那里没有任何有用的东西。 Is there anyway to figure out what other module Eclipse thinks it's pulling that package from? 无论如何,有没有办法弄清Eclipse认为从中提取该软件包的其他模块是什么?

My next step is to delete the entire project and re-import it. 我的下一步是删除整个项目,然后重新导入。

UPDATE: I think I may have found the offender... there's a dependency that declares a couple of classes into the java.sql package, and that's probably borking things up. 更新:我想我可能已经发现了违规者...有一个依赖项在java.sql包中声明了几个类,这可能使事情变得很无聊。 The specific JAR is net.sourceforge.hatbox:hatbox:1.0.b8, and is a transitive dependency of the com.h2database:h2:1.4.197 jar. 特定的JAR是net.sourceforge.hatbox:hatbox:1.0.b8,并且是com.h2database:h2:1.4.197 jar的传递依赖项。 Is there any way to tell eclipse to ignore the package from that JAR? 有什么办法让eclipse忽略该JAR中的软件包?

Update 2: Build Path: 更新2:构建路径: 建立路径1之4 建立路径2之4 构建路径3之4 构建路径4之4

I'm not sure I count this as a true solution, but I was able to find a workaround to my problem. 我不确定我是否认为这是一个真正的解决方案,但是我能够找到解决问题的方法。 I downgraded eclipse from the installed version listed in the question (4.11.0) to the base photon install (4.8.0), and I can now compile and work again. 我将eclipse从问题(4.11.0)中列出的已安装版本降级为基本photon install(4.8.0),现在可以编译并再次工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM