- extract the zip package downloaded from the official website to the corresponding directory
- the environment variable is configured
MAVEN_HOME = C:\ Program Files\ Apache Software Foundation\ apache-maven-3.5.3
Path
add ;% MAVEN_HOME%\ bin
Path also added % SystemRoot%\ system32;%SystemRoot%;%SystemRoot%\ System32\ Wbem;
still has no effect.
- make sure you have administrator privileges, and the same is true for changing to the directory on disk D.
- is executed directly in the directory, and it is valid to change it to
.\ mvn-v
as prompted.
PS C:\Program Files\Apache Software Foundation\apache-maven-3.5.3\bin> mvn -v
mvn : "mvn" cmdlet
:1 : 1
+ mvn -v
+ ~~~
+ CategoryInfo : ObjectNotFound: (mvn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: mvnWindows PowerShell ".\mvn" "get-help about_Command_Precedence"
PS C:\Program Files\Apache Software Foundation\apache-maven-3.5.3\bin> .\mvn -v
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.5.3\bin\..
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jre1.8.0_144
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
refer to some online solutions, all of which are ineffective.
but it works in IntelliJ!