java -version
运行正常:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
在配置Maven之后,mvn -version
没有出现。
The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK, not a JRE 'cmd' is not recognized as an internal or external command, operable program or batch file.
答案 0 :(得分:1)
确保已设置JAVA_HOME环境变量并指向您的JDK安装
例如:
$ echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64/jre
安装JDK后,通常应该配置一个JAVA_HOME
环境变量。但是,您也可以手动创建它。