今天在安装maven时安照说明配置环境变量,通过命令检查:
mvn -v
出现以下错误
ERROR: JAVA_HOME is set to an invalid directory.
JAVA_HOME = D:/jdk1.5.0_15;
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation
JAVA_HOME = D:/jdk1.5.0_15;
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation
但是我已经配置了JAVA_HOME,并且通过 cmd 运行 javac 也能看到java的配置信息
经过多次测试,最终当在环境变量中
JAVA_HOME = D:/jdk1.5.0_15
后面不要加
“;”(之前之所以出现这个错误,就是因为这个分号)
配置好后再执行
mvn -v 得到如下:
C:/Documents and Settings/Administrator>mvn -v
Maven version: 2.0.9
Java version: 1.5.0_15
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
Maven version: 2.0.9
Java version: 1.5.0_15
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"