How To "Turn Off" A Plugin And Project Using The "Module Path"? [message #1818765] |
Fri, 27 December 2019 17:33 |
Steve _____ Messages: 48 Registered: April 2012 |
Member |
|
|
Eclipse IDE for RCP and RAP Developers
Version: 2019-06 (4.12.0)
Build id: 20190614-1200
OS: Linux, v.3.10.0-957.5.1.el7.x86_64, x86_64 / gtk 3.22.30, WebKit 2.20.5
Java version: 11
I am helping to migrate a project from Java 8 to Java 11. The project consists of 100s of plugins(projects) bundled together to act as one massive application.
One of those plugins(projects) inadvertently got set to use the Java 9 "module path". We aren't using jigsaw.
The result is 8 compiler errors roughly along the lines of
The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
I've tried removing java.xml from the Build Path > Configure Buildpath > Module Dependencies tab, but that creates 2 new errors:
The project was not built since its build path is incomplete. Cannot find the class file for java.awt.geom.Rectangle2D. Fix the build path then try building this project
The type java.awt.geom.Rectangle2D cannot be resolved. It is indirectly referenced from required .class files
I was able to fix those by adding java.desktop to the Module Dependcies tab, but then the original 8 errors come back :).
Googling around it seems like the thing I need to do is to tell Eclipse that this plugin/project does not want to use Jigsaw or the Java9 module path.
How can I do that?
Thanks
Steve
[Updated on: Fri, 27 December 2019 23:13] Report message to a moderator
|
|
|
Re: How To "Turn Off" A Plugin And Project Using The "Module Path"? [message #1818772 is a reply to message #1818765] |
Fri, 27 December 2019 22:30 |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
Steve _____ wrote on Fri, 27 December 2019 18:33
[...]
I am helping to migrate a project from Java 8 to Java 11. The project consists of 100s of plugins(projects) bundled together to act as one massive application.
[...]
The result is 8 compiler errors roughly along the lines of
The package javax.xml.stream is accessible from more than one module: <unnamed>, java.xml
This very much sounds like https://stackoverflow.com/questions/51094274/eclipse-cant-find-xml-related-classes-after-switching-build-path-to-jdk-10/53824670#53824670 but seeing that you already tried to fix this on the "Module Dependencies tab" this may not be news to you.
Quote:
I've tried removing java.xml from the Build Path > Configure Buildpath > Module Dependencies tab, but that creates 2 new errors, which when fixed, bring back the original 8.
It might be interesting to see what 2 new errors you saw, and how you tried to fix them.
Quote:
Googling around it seems like the thing I need to do is to tell Eclipse that this plugin/project does not want to use Jigsaw or the Java9 module path.
This is not strictly possible. As soon as you compile against a JRE >= 9, this JRE will consist of modules, and you have to follow the rules of JPMS (formerly code named Jigsaw). If your own code does not define any modules, then your code lives in the "unnamed module", but still the rules of modules apply.
Regular libraries can be moved back and forth between classpath and module path, but this is not possible for a modular JRE.
Sorry, but those are the rules.
Stephan
|
|
|
|
|
Re: How To "Turn Off" A Plugin And Project Using The "Module Path"? [message #1818787 is a reply to message #1818785] |
Sat, 28 December 2019 11:53 |
Steve _____ Messages: 48 Registered: April 2012 |
Member |
|
|
Stephan Herrmann wrote on Sat, 28 December 2019 05:36java.awt.geom.Rectangle2D is in the system module "java.desktop". Since java.desktop requires "java.xml" you cannot remove the system module java.xml. Instead, you should make sure that no other library in your dependencies provides packages java.xml.*.
By dependencies do you mean the classpath?
Here are some screen shots of my Build Path dialog tabs. I've seen some javax.xml jars in my class path but the button to remove them is greyed out.
[Updated on: Mon, 30 December 2019 16:09] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03377 seconds