java - Maven 安装的运行时为 JRE 而不是 JDK
问题描述
我已经在我的系统中下载了 Maven 并提供了路径设置。
当我跑步时mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\apache-maven-3.6.3\bin\..
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: **C:\Program Files\Java\jre1.8.0_251**
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
运行时应该有 JDK,但它显示 jre。
在环境路径 - USER 变量 -
JAVA_HOME
-C:\Program Files\Java\jdk1.8.0_251
MAVEN_HOME
-C:\apache-maven-3.6.3
系统变量 -
- 小路 -
C:\apache-maven-3.6.3\bin
当我跑步时——mvn
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.132 s
[INFO] Finished at: 2020-07-13T15:45:37+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/NoGoalSpecifiedException
运行 mvn 包也会给我以下错误 -
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.146 s
[INFO] Finished at: 2020-07-13T22:44:10+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\A7704913). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
我怎样才能使运行时成为 JDK 而不是 JRE。
解决方案
推荐阅读
- docker - 理解 docker create 命令行参数
- python-3.x - 如果前一个指标 R 存在,Python 将值清零
- c++ - 访问冲突写入位置动态分配数组
- css - 我想要可滚动的
在顶部标题的表格中 - mongodb - 在 MondoDB 指南针中仅过滤电子邮件地址并导出
- next.js - 如何使用 Next.js 自动静态站点优化并仍然为 Netlify 导出?
- python - img scr 在 jupyter notebook 中显示无效语法
- azure-active-directory - 如何使用服务主体访问 Azure 数字孪生 API?
- sql - 使用粘性项目订购 SQL 结果
- reactjs - 在本机反应中,键盘在按键时自动隐藏