MavenReportException:The environment variable JAVA_HOME is not correctly set.错误异常解决方法

用Maven打包带javadoc项目,提示错误信息如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.7:jar 
(attach-javadocs) on project api: MavenReportException: 
Error while creating archive:Unable to find javadoc command: 
The environment variable JAVA_HOME is not correctly set. -> [Help 1]

出现这个问题,是因为 JAVA_HOME指向了JRE而不是JDK:


所以解决办法是在maven javadoc插件中手动配置:

 
  
${java.home}/../bin/javadoc

如下:
 
  


你可能感兴趣的:(MavenReportException:The environment variable JAVA_HOME is not correctly set.错误异常解决方法)