简体   繁体   中英

Could not find artifact com.sun:tools:jar:14.0.1

I upgraded my Mac OS from Sierra to Catalina. Ever since I did that, my work environment has been broken. When I run maven verify on my local, I get this error -

Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.9:compile (default) on project sipstack: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.9:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.9 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:14.0.1 at specified path /usr/local/Cellar/openjdk/14.0.1/libexec/openjdk.jdk/Contents/Home/../lib/tools.jar

After going through some of the similar threads around here, I realized that the OS upgrade may have messed up with the java system path. I did an echo $JAVA_HOME on my terminal and it returned empty. Then I searched tools.jar in Finder and saw that this file resides at /Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home/lib/ . Then I set the JAVA_HOME variable to JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/ and ran mvn verify again. Unfortunately I got the same error.

Can someone tell what might be the problem here? Or where is this path coming from?

/usr/local/Cellar/openjdk/14.0.1/libexec/openjdk.jdk/Contents/Home/../lib/tools.jar

One possible solution is to upgrade aspectj-maven-plugin that supports Java 11+. Suggestion: use this plugin instead: https://search.maven.org/artifact/com.nickwongdev/aspectj-maven-plugin/1.12.6/maven-plugin

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