简体   繁体   中英

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. I'm using the following Eclipse configuration:

  • Version: 2019-03 M1 (4.11.0 M1)
  • Build id: 20190117-2133
  • 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). When attempting to compile it, eclipse throws up its hands and sends the message

"The package java.sql is accessible from more than one module: <unnamed>, 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. This also happens with the javax.xml package with the same error.

I've attempted closing and re-opening eclipse, performing a clean, and a maven update project for everything, to no avail. I've inspected the eclipse .log file, and there's nothing useful in there. Is there anyway to figure out what other module Eclipse thinks it's pulling that package from?

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. 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. Is there any way to tell eclipse to ignore the package from that JAR?

Update 2: Build Path: 建立路径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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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