mvn command is not recognized as an internal or external command

前端 未结 22 2384
执念已碎
执念已碎 2020-12-30 19:20

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

22条回答
  •  轮回少年
    2020-12-30 19:27

    Restart your machine, after setting up your M2_HOME (pointing to you Maven basedir, NOT the bin dir) and PATH (PATH=%M2_HOME%\bin;%PATH%).

    Then do:

    dir %M2_HOME%\bin\mvn*
    

    If there is a .bat file, it should work under Windows, as it appears to be finding it. If there isn't one, then your paths are not right and you need to make sure your %PATH% variable really points to the correct path to Maven.

    Make sure you are using the proper slashes for your OS. Under Windows they're \.

提交回复
热议问题