This is the 17th day of my participation in the August Challenge

If ❤️ my article is helpful, welcome to like, follow. This is the biggest encouragement for me to continue my technical creation. More previous articles in my personal column

Java sets environment variables

  • The system variable must be namedJAVA_HOMEThe value of the variable is the JDK installation path.
  • Also create a new variable name:CLASSPATH, variable value:.; %JAVA_HOME%\lib\dt.jar; %JAVA_HOME%\lib\tools.jar
  • Find the original system variablePathVariable, double-click to editPathThe variable. Click New, set the variable value to %JAVA_HOME%\bin and move it to the front, then click OK.

Check whether the configuration is successful

Press the keyboard Win +R to open the run, enter CMD command, and click OK to enter the command line window. Type Java -version to get the version information of the currently installed JDK (note: Java is followed by a space)

C:\Users\Administrator>java -version
java version "1.8.0 comes with _151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Copy the code

Maven installation

To use the Maven management tool, you need to download the installation software from the official website. Maven download

Maven installation is not particularly complicated, just unzip it. In the system environment variables MAVEN_HOME, Path, you can test use

Maven environment variable configuration (apache-maven-38.1-bin.zip)

  • configurationMAVEN_HOMEThe value of the variable is yoursPath for installing Maven(Level 1 directory before bin directory)
  • willMAVEN_HOMEAdd to the Path system variable,%MAVEN_HOME%\bin

The loading speed of foreign Maven sources in China is relatively slow, so the operation of changing domestic Maven dependency sources is generally added in project PUM.xml. To improve the dependency loading speed, the code is as follows:

<mirror>

<id>alimaven</id>
    <name>aliyun maven</name>
    <url>
        http://maven.aliyun.com/nexus/content/groups/public/
    </url>
    <mirrorOf>central</mirrorOf>        
</mirror>
Copy the code

Verify that Maven is successfully installed

To verify maven installation, run the MVN -v command to check whether the following version information is displayed

> MVN -v Apache Maven 3.8.1 c21c65bdfed0f71a2f2ada8b84da59348c4c5d (05) Maven home: D: / Dev/env \ maven381 \ bin \.. Java version: 1.8.0_151, Vendor: Oracle Corporation, Runtime: D:\Dev\env\ Java \jdk1.8\ JRE Default locale: zh_CN, platform encoding: GBK OS name:"windows 10", version: "10.0", arch: "amd64", family: "windows"
Copy the code

Once maven is successfully installed, you can use Maven to package the project JARS. Run the MVN install command in the project root directory

+ + + — — — — — / / / / – / – / / / * * /