mvn not recognized as an internal or external command error

0 votes
I am trying to install maven on windows. I have downloaded the apache and extracted it on my C:\Program Files\apache-maven-3.6.1. I already have jdk 1.8 installed in my system and also have configured the JAVA_HOME and MAVEN_HOME environment variables via the system properties.I have also ensured that i have added their respective bin locations on the PATH variable. Still i am encountering the above error. Kindly help!
Jun 3, 2019 in DevOps Tools by Namik
• 1,210 points

1 answer to this question.

0 votes

Setting the environment variables JAVA_HOME, MAVEN_HOME and  PATH  via the system property settings may not be effective sometimes.In the command prompt, echo %JAVA_HOME% ,%MAVEN_HOME%, %PATH% and check the values if they are correctly set and included in the PATH as well. if not, you need to set those Environment variables via the command prompt using the following command:

setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_211"

setx PATH "%PATH%;%JAVA_HOME%\bin";

same for MAVEN_HOME as well.

setx MAVEN_HOME "C:\Program Files\apache-maven-3.6.1"

setx PATH "%PATH%;%MAVEN_HOME%\bin";

You can check if these are set appropriately by running the commands:  java -version and mvn --version on the command prompt.

answered Jun 3, 2019 by Sirajul
• 50,440 points

Related Questions In DevOps Tools

0 votes
1 answer

Getting an Error while trying to push changes to cloud foundry

Here is an approach which you can ...READ MORE

answered Jul 19, 2018 in DevOps Tools by Atul
• 10,250 points
+4 votes
2 answers

Jenkins not showing Maven Release Plugin

Make your project type Maven Project. This ...READ MORE

answered Oct 11, 2018 in DevOps Tools by Hannah
• 18,030 points
0 votes
1 answer
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,400 points
0 votes
1 answer
0 votes
1 answer

Is terraform alternative to configuration management tools like ansible or puppet??

Ansible/Puppet/Chef is primarily a configuration management tool, ...READ MORE

answered Feb 3 in DevOps Tools by anonymous
• 50,440 points
0 votes
1 answer

Can I configure my virtual machine as slave in Jenkins?

You can certainly use a virtual machine ...READ MORE

answered Feb 4 in DevOps Tools by anonymous
• 50,440 points