Apache Maven 安装“'mvn' 未被识别为内部或外部命令"设置操作系统环境变量后? [英] Apache Maven install "'mvn' not recognized as an internal or external command" after setting OS environmental variables?

查看:18
本文介绍了Apache Maven 安装“'mvn' 未被识别为内部或外部命令"设置操作系统环境变量后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照官方安装说明此处针对 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.

那么,是什么?

推荐答案

解决方案是将 M2user 变量移动到 system 变量

Way around would be moving M2 from user variables to system variables

这篇关于Apache Maven 安装“'mvn' 未被识别为内部或外部命令"设置操作系统环境变量后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆