使用Ubuntu 16.10和JDK 1.8.0,我在maven版本(3.3.9)中得到了这个结果:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (check) on project parent: Execution check of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check failed: Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.17 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.8.0 at specified path /usr/lib/jvm/java-8-openjdk-amd64/jre/../lib/tools.jar -> [Help 1]JAVA_HOME设置为此路径。什么可能会导致这种情况?
发布于 2017-05-05 16:14:16
由于您使用的是OpenJdk而不是OracleJDK,因此您的系统中可能没有可用的com.sun包。
您可以通过尝试使用OracleJdk在系统上构建项目来验证这一点。
发布于 2017-07-08 00:00:29
也许这是由环境变量引起的,试试这个:
export JAVA_HOME =/~.../dirictoryOfYourJDK
export M2_HOME =/~.../dirictoryOfYourMaven
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin我希望这对你有帮助
https://stackoverflow.com/questions/43798564
复制相似问题