maven installation and environment variable configuration

               In fact, the installation of maven is very simple, two steps:

1. Download and unzip

        Go to the maven official website http://maven.apache.org/download.cgi to download the package. Generally, the latest version is displayed on the download page. There are several formats. You can download the next one to the defined path. This path is the installation directory, for example, I now download and unzip it to F:\newdownsoft\apache-maven-3.5.2. Note that the download must be complete, otherwise it will cause a lot of problems later.

2. Configure environment variables

  •  Configure the MAVEN_HOME variable: the configuration value is the installation directory, namely F:\newdownsoft\apache-maven-3.5.2.
  • Update the PATH variable: The operation of maven first requires jdk to be installed, and the path variable should be configured first, so here just add %MAVEN_HOME%/bin to the end of the path, as shown in the figure:



  

After that, you can open the command line window and enter mvn -v to check the version. If there is version information output, it means the installation is successful, otherwise it fails. You can check the reason for the failure according to the failure prompt. The first time I tried, it appeared that the class could not be found. mistake:


When I compared the size, it was because I didn't download it completely when I downloaded it, and I was missing something. It would be OK to re-download a complete version.



 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326024715&siteId=291194637