在idea中编写maven的pom脚本,想为项目的主代码生成javadoc文件,结果却提示"JAVA_HOME"变量设置不正确,具体提示如下:
Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project QSProject: Error during page generation: Error rendering Maven report: Unable to find javadoc command:The environment variable JAVA_HOME is not correctly set. -> [Help 1]
解决方案就是:
打开idea的preference,找到Maven,打开maven里的Runner,点击右边的"..."进入编辑对话框,添加进去即可,下面贴出图片:
也可参见:
http://stackoverflow.com/questions/20313453/java-home-on-osx-with-eclipse-and-maven