mvn command is not recognized as an internal or external command

前端 未结 22 2297
执念已碎
执念已碎 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:51

    1. Try with echo %path% , if this option doesn't show your M2_HOME and others variable values as directory path, then create a new environment variable lets say PATH, and assign like below:

      PATH=%JAVA_HOME%\bin;%M2_HOME%\bin
      
    2. Add this in variable path=.....;%PATH%

    3. Now open a new cmd, and try to echo %path%
      it will show all thh system path

    Now you can check mvn -version it will solve the problem , if not try to restart the system

    P.S. as per doc, you should expend your zip distribution in C:\Program Files\Apache Software Foundation. But ideally it doen't matter

提交回复
热议问题