Apache Maven 安装“'mvn' 未被识别为内部或外部命令"设置操作系统环境变量后? [英] Apache Maven install "'mvn' not recognized as an internal or external command" after setting OS environmental variables?
问题描述
我已按照官方安装说明此处针对 Windows XP.但有时当我执行 mvn --version
时,我收到错误信息,
I've followed the official installation instructions here for Windows XP. But sometimes when I execute mvn --version
, I receive the error message,
'mvn' 未被识别为内部或外部命令
'mvn' not recognized as an internal or external command
我什至重新启动了我的机器几次,但操作系统并不总是识别 maven 命令.但是当我执行 cd %M2_HOME%
或 cd %M2%
时,它会将我带到安装目录.我还确保将用户变量 M2
添加到 Path
系统变量.
I've even rebooted my machine a couple times, but the OS does not always recognize the maven command. But when I execute either, cd %M2_HOME%
, or cd %M2%
it brings me to the installation directory. I've also made sure to add the user variable M2
to the Path
system variable.
那么,是什么?
推荐答案
解决方案是将 M2
从 user 变量移动到 system 变量
Way around would be moving M2
from user variables to system variables
这篇关于Apache Maven 安装“'mvn' 未被识别为内部或外部命令"设置操作系统环境变量后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!