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

标签 java

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/

相关文章:

Java 重复使用替换方法

java - 使用 lambda 过滤嵌套列表

java - 使用 zipfileset 将错误的 JAR 打包到 ant 文件中

java - 如何将动态 json 转换为 java 类?

java - SensorEvent.timestamp 和 Location.getElapsedRealtimeNanos() 时间戳延迟偏移

java - GCD输入数

java - Java 中类型对象的 ArrayList - 我似乎无法弄清楚的错误

java - 当我的测试失败且 chrome 浏览器关闭之前(@After)时,如何对 chrome 浏览器进行屏幕截图

java - JPA:从数据库获取数据而不是持久性上下文

java - Spring Boot - Docker 日志