简体   繁体   English

mvn - 在 Windows 11 中不被识别为内部或外部命令

[英]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.我已经下载了二进制 mvn 文件,将其解压缩并将 MAVEN_HOME 系统变量和 %MAVEN_HOME%\bin 添加到路径中。 https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip 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.我尝试了多个不同的目录,多次重新启动 PC 并在管理员模式下运行 cmd prmpt 以消除对我的任何可能性。

在此处输入图像描述

Update: I don't see the .cmd files after extraction.更新:提取后我看不到 .cmd 文件。 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.隐藏文件已启用,当我从 mvn 文件手动创建 .cmd 文件时,它仍然不起作用。 在此处输入图像描述

Note: I have installed maven atleast in 10 other machines in the past.注意:我过去至少在其他 10 台机器上安装了 maven。 But never stuck as badly.但从未如此糟糕。

Solved it myself.自己解决了。 Using the winRAR to extract the downloaded bin.zip file caused the problem.使用 winRAR 解压下载的 bin.zip 文件导致问题。 When accessed directly through winrar, the .cmd files (.bat in older version of maven) were present.当通过 winrar 直接访问时,存在 .cmd 文件(旧版本的 maven 中的 .bat)。 在此处输入图像描述 But after extracting to a folder, the files are missing.但解压到文件夹后,文件丢失了。 在此处输入图像描述

Root Cause: For security reasons, WinRAR is omitting .cmd and .bat files from extraction list by default.根本原因:出于安全原因,WinRAR 默认从提取列表中省略 .cmd 和 .bat 文件。 在此处输入图像描述

Using the default "Extract All.." option from right click menu resolved this.使用右键菜单中的默认“Extract All..”选项解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 mvn'不被识别为内部或外部命令 - mvn' is not recognized as an internal or external command npm在Windows中不被识别为内部或外部命令 - npm is not recognized as an internal or external command in windows adb 在 Windows 上未被识别为内部或外部命令 - adb is not recognized as internal or external command on windows 在Windows 7中,javac不被识别为内部或外部命令 - javac is not recognized as an internal or external command in windows 7 CPAN“。” 不被识别为内部或外部命令 - Windows 10 - CPAN "." is not recognized as an internal or external command - Windows 10 windows 上的 pyenv - 未被识别为内部或外部命令 - pyenv on windows - not recognized as internal or external command 'composer' 在 windows 服务器中未被识别为内部或外部命令 - 'composer' is not recognized as an internal or external command in windows server 'which' 在 Windows 7 中不被识别为内部或外部命令 - 'which' is not recognized as an internal or external command in windows 7 'sed' 不被识别为内部或外部命令 (Windows 10) - 'sed' is not recognized as an internal or external command (Windows 10) $不被识别为内部或外部命令 - $ is not recognized as an internal or external command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM