2

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 (e.g.: 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: build path 1 of 4 build path 2 of 4 build path 3 of 4 build path 4 of 4

Robert K
  • 472
  • 4
  • 17
  • First you need to tell it Maven and not Eclipse... – khmarbaise Jan 28 '19 at 18:48
  • They're all imported as Maven projects, is that what you mean? Also, this compiles fine on the command line via Maven – Robert K Jan 28 '19 at 19:59
  • Where do you get the error message? In the Console view when running a Maven build or in the Problems view and in the Java editor? Please show your Java Build Path. – howlger Jan 28 '19 at 23:36
  • It's in the problem views and the Java Editor. The build path is pretty ridiculous, but I'll use screenshots of it. – Robert K Jan 29 '19 at 16:34

1 Answers1

0

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.

Robert K
  • 472
  • 4
  • 17