• Register
0 votes

Problem :

When ever I run mvn --version command from inside the bin it gives me the version but when I run it from the outside of bin it gives following exception :

'mvn' is not recognized as an internal or external command, operable program or batch file.

6.9k points

2 Answers

0 votes

Solution :

To solve the issue please perform following steps:

Firstly do right click on My Computer >> Properties >> Advanced system settings >> System Properties >> Under Advanced >> Environment Variables

Now click on New to set Environment Variables as below

Variable name: JAVA_HOME 

Variable value: C:\Program Files\Java\jdk1.8.0_121

Variable name: M2 

Variable value: %M2_HOME%\bin

Variable name: M2_HOME 

Variable value: C:\Program Files\Apache Software Foundation\apache-maven-3.5.0

Variable name: Path 

Variable value: %M2_HOME%\bin

After that please click on Ok.Now you need to restart your command prompt and check again with “mvn –version” to verify that the mvn is running.

It will Work Enjoy :)

36.1k points
0 votes

This the most commonly used error that occurs with the command prompt. As the error itself suggests that it could not recognize the tool you are trying to use with the command prompt.

Reasons for this error:

  • One of the most common reasons that your PC has installed another app that modified tour system variables.
  • The second reason is that you don’t have installed an appropriate program on your computer.

Fixing error in windows:

You can fix your error by using any of the following methods.

  • For solving this error, first, ensure that the program actually exists on your PC. Sometimes you may have a fake installer that told that the program was successfully installed on your computer, but actually it is not.
  • Use the full path to the executable files and it should be able to run it without any issues.
  • Enclose the file path with double-quotes. If the executable file contains many spaces, then it is going to cause an error.
  • Copy executable file along with all other associated files to the folder System32 on your computer.
  • Add all executable files to the environment variable. By adding files there you can tell the command prompt where a certain file is located and you can use it by its short name in CMD window.


3.9k points

Related questions

0 votes
2 answers 177 views
Problem : I get the following error when I execute jar command in cmd. 'jar' is not recognized as an internal or external command, operable program or batch file. I tried very hard to solve this problem by myself by putting the path of the jar.exe file in my "path" variable ... I got the same error. Please let me know my mistake and how to fix it. I need to create jar files via the command line.
asked Nov 21, 2019 peterlaw 6.9k points
0 votes
1 answer 604 views
Problem : I have encountered following keytool error 'openssl' is not recognized as an internal or external command, operable program or batch file.
asked Nov 13, 2019 peterlaw 6.9k points
1 vote
1 answer 128 views
Problem: I installed flask in my system by running the command: pip install flask Collecting flask Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB) |████████████████████████████████| ... operable program or batch file. Whats the problem running this can any one tell me? Thanks in advance.
asked May 12 samhaz 5k points
0 votes
1 answer 28 views
I am new to python programming. I am using atom IDE or atom editor for my python programs but every time I try to run a code or a script from my atom editor it gives me an error like : atom 'python' is not recognized as an internal or external command, operable ... and atom for 64 bit windows. Can anyone figure out what the problem really is and how can I solve this problem and run my code.
asked Mar 10 LizzyM 5.7k points
0 votes
1 answer 493 views
Problem : I am new to type script and unable to compile my type script file. When I try to hit Ctrl+Shift+B in my VS Code, I face below error " ‘Tsc' is not recognized as an internal or external command, operable program or batch file." I used ... C:\Users\mphil\AppData\Roaming\npm\node_modules\typescript\bin\tsc C:\Users\mphil\AppData\Roaming\npm `-- typescript@2.1.5 How to fix above error?
asked Feb 15 mphil 2.3k points