问题
I am trying to develop with Eclipse 2020.6 and m2e using openJDK-11 on Win10.
The computer is maintained by IT department having jre-8 in its PATH and I dot have the rights to change that.
I have installed JDK11 below my user folder.
Changed eclipse.ini for Eclipse and toolchain.xml for commandline Maven.
I also checked Module Dependencies in Java Build Path: com.sun.tools.jar is no longer there.
Commandline Maven and Eclipse are using JDK11 instead of jre-8, except the eclipse-editor for pom.xml.
It shows Missing artifact com.sun:tools:jar:1.8.0
I checked Dependency Hierarchie with the pom.xml editor and it shows that ant:1.10.8 depends on tools:1.8.0. But this information must be wrong, as the project tests and installs correctly.
I guess, the eclipse-editor for pom.xml somehow does not use the java libaries pointed to by eclipse.ini or toolchain.xml or those configured with the project Build Path.
Eclipse Preferences/Maven/User Settings points to the local repository .m2\repository and to the user settings .m2\settings.xml. I also copied toolchain.xml to .m2, but without solving the problem.
Please note that I do not have any problem running Maven from within Eclipse. It works as expected. My problem is, that errors are flagged within Eclipse where there is none.
Why does the pom.xml editor in Eclipse complains about tools.jar:1.8.0? How can I make m2e not using java from the PATH but using JDK11 installation for my developments in Eclipse?
来源:https://stackoverflow.com/questions/63761785/pom-xml-marks-missing-artifact-com-suntoolsjar1-8-0