Dinesh Babu
Dinesh Babu

Reputation: 73

mvn - is not recognized as an internal or external command in Windows 11

I have downloaded binary mvn file, extracted it and added the MAVEN_HOME system variable and %MAVEN_HOME%\bin to path. https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip

I have tried multiple different directories, restarted PC multiple times and also ran cmd prmpt in administrator mode to eliminate any odds against me.

enter image description here

Update: I don't see the .cmd files after extraction. Files are present before extraction. Hidden files are enabled and when I create a .cmd file manually from mvn file, it still doesn't work. enter image description here

Note: I have installed maven atleast in 10 other machines in the past. But never stuck as badly.

Upvotes: 0

Views: 560

Answers (1)

Dinesh Babu
Dinesh Babu

Reputation: 73

Solved it myself. Using the winRAR to extract the downloaded bin.zip file caused the problem. When accessed directly through winrar, the .cmd files (.bat in older version of maven) were present. enter image description here But after extracting to a folder, the files are missing. enter image description here

Root Cause: For security reasons, WinRAR is omitting .cmd and .bat files from extraction list by default. enter image description here

Using the default "Extract All.." option from right click menu resolved this.

Upvotes: 1

Related Questions