龙空技术网

Maven 项目执行的时候提示 JAVA_HOME is not correctly set 错误

iSharkFly 79

前言:

现时看官们对“notjavahome”大体比较注意,兄弟们都需要学习一些“notjavahome”的相关文章。那么小编同时在网络上搜集了一些有关“notjavahome””的相关知识,希望姐妹们能喜欢,你们快快来学习一下吧!

提示的错误信息如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project codebank: MavenReportException: Error while creating archive: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set. -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] 

如下图:

问题和解决

上面的提示已经比较清楚了。

你没有在你的环境变量中设置 JAVA_HOME

需要按照上面的设置一个环境变量。

如果你使用的是 IEDA 的话,你需要重启的 IDEA 环境。

如果你使用的是命令行工具的话,你也需要退出后重启。

然后再次进行编译,应该就能解决上面的问题了。

标签: #notjavahome