英文:
Can't use maven command-line tool
问题
以下是您在终端中使用Maven时收到的消息的翻译:
JAVA_HOME环境变量未正确定义,
需要定义此环境变量才能运行该程序。
这是JAVA_HOME环境变量的定义:
echo $JAVA_HOME
/usr/lib/jvm/default-runtime/bin/java
java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7)
OpenJDK 64-Bit Server VM (build 19.0.2+7, mixed mode)
英文:
Here is the message I get when I try to use maven in the terminal:
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
This is the definition of the JAVA_HOME environment variable:
echo $JAVA_HOME 1 ✘
/usr/lib/jvm/default-runtime/bin/java
java --version ✔
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7)
OpenJDK 64-Bit Server VM (build 19.0.2+7, mixed mode)
答案1
得分: 3
看起来你将 JAVA_HOME
设置为指向 java
可执行文件,而不是应该指向包含 Java 安装的目录。应该是
export JAVA_HOME=/usr/lib/jvm/default-runtime
英文:
It looks like you set JAVA_HOME
to point to the java
executable, not the directory containing the Java installation, as it should be
export JAVA_HOME=/usr/lib/jvm/default-runtime
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论