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 mavenbin.zip 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 in DevOps Tools by Namik
• 1,200 points
218 views

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 by Sirajul
• 19,070 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,240 points
139 views
+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
• 14,090 points
649 views
0 votes
1 answer
0 votes
1 answer

running comands as non-root user while using docker-maven plugin

Docker needs root access therefore maven commands ...READ MORE

answered Apr 30, 2018 in DevOps Tools by ajs3033
• 7,280 points
491 views
0 votes
3 answers
+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,380 points
120 views
0 votes
1 answer