gpt4 book ai didi

java - Maven : Getting compilation error using the Install command through cmd

转载 作者:太空宇宙 更新时间:2023-11-04 13:04:45 34 4
gpt4 key购买 nike

Compilation error on using Maven Install command

嗨,当我使用 Maven clean 命令时,它运行成功,但是当我运行 install 命令时,我一直收到编译错误。以下是我收到的错误。谢谢

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TigerFinal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TigerFinal ---
[INFO] Deleting C:\Users\Shashank_bisht\workspace\TigerFinal\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.517 s
[INFO] Finished at: 2016-01-04T22:53:12+05:30
[INFO] Final Memory: 6M/105M
[INFO] ------------------------------------------------------------------------

C:\Users\Shashank_bisht\workspace\TigerFinal>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TigerFinal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TigerFinal ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Shashank_bisht\workspace\TigerFinal\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ TigerFinal ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to C:\Users\Shashank_bisht\workspace\TigerFinal\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/MyHomepage/Home.java:[11,27] packa
MyHomepageTestCases does not exist
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/Utils/AppUtils.java:[14,27] packag
yHomepageTestCases does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.733 s
[INFO] Finished at: 2016-01-04T22:53:26+05:30
[INFO] Final Memory: 17M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
project TigerFinal: Compilation failure: Compilation failure:
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/MyHomepage/Home.java:[11,27] packa
MyHomepageTestCases does not exist
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/Utils/AppUtils.java:[14,27] packag
yHomepageTestCases does not exist
[ERROR] -> [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] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

最佳答案

来自评论:

您需要完整的 JDK(Java 开发工具包),而不是 JRE(Java 运行时环境)

从 OpenJDK 或 Oracle 下载 JDK,然后 set the environment variable JAVA_HOME 到 JDK 的根文件夹。

然后重试您的 Maven 命令

关于java - Maven : Getting compilation error using the Install command through cmd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34596612/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com