Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

maven - mvn command is not recognized as an internal or external command

I am getting the mvn command not recognized as an internal or external command.

I have setup the M2_HOME, JAVA_HOME and added %M2_HOME%/bin to the path variable. All are system variables. Still getting the same problem.

Echoing the variables showing me the correct paths.

Path to Maven: C:apache-maven-3.1.0apache-maven-3.1.0

M2_HOME:C:apache-maven-3.1.0apache-maven-3.1.0

PATH: Other things,C:Program Files (x86)Javajdk1.7.0_40in,C:apache-maven-3.1.0apache-maven-3.1.0in

and I have restarted my computer twice.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Right click on My Computer >> Properties >> Advanced system settings >> System Properties window will get displayed Under Advanced >> Environment Variables

Click on New to set Environment Variables

Variable name: JAVA_HOME Variable value: C:Program FilesJavajdk1.8.0_121

Variable name: M2 Variable value: %M2_HOME%in

Variable name: M2_HOME Variable value: C:Program FilesApache Software Foundationapache-maven-3.5.0

Variable name: Path Variable value: %M2_HOME%in

Then click on Ok, ok, ok. Now restart you command prompt and check again with “mvn –version” to verify the mvn is running, you may restart your system also.

It's Working...... Enjoy :)

Thanks Sandeep Nehte


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...