Old ERP system on Java 11 classpath only [message #1804909] |
Wed, 03 April 2019 03:59  |
Eclipse User |
|
|
|
Migrating an old ERP system to JPMS turned out to be highly problematic (https://stackoverflow.com/questions/55256736/java-11-eclipse-finds-automatic-module-maven-does-not), so I decided to first try and simply replace Java 8 with Java 11, but keep everything on the classpath by not introducing any module-info.java files. That actually went quite smoothly; Maven is compiling this without problems, and the resulting application also starts from the command line.
But when I import that Maven project into Eclipse 2019-03 it complains about a.o. java's xml packages, for example this import:
import javax.xml.namespace.QName;
This makes sense, because the JRE is modularized, and those classes are in the java.xml module which I am not included. But why is Maven then compiling correctly AND the application starting under J11?
I suspect I need to tell Eclipse to "--add-modules=ALL-SYSTEM" for this project, but I'm not sure where or how. I've tried moving all the JDK/JRE modules in the build-path/libraries from implicit to explicit, but that does not help.
|
|
|
|
|
|
|
|
|
|
|
Re: Old ERP system on Java 11 classpath only [message #1808164 is a reply to message #1804909] |
Tue, 18 June 2019 07:55  |
Eclipse User |
|
|
|
You probably have some redundant xml api jars on the classpath and javac (incorrectly) doesn't complain because of JDK-8215739, but Eclipse already (correctly) does after bug 536928
At runtime, the JVM seems to ignore packages on the classpath that already appear in a named module, so javac's behavior is actually consistent with that.
To fix your problem: Try "Open Type" to find any copies of javax.xml.namespace.QName in jars on your classpath and exclude those dependencies in your pom.xml
erp software
erp systems
[Updated on: Wed, 10 July 2019 02:47] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03454 seconds