Installation and configuration of JDK and Maven in WIN10 system of java basic skills

As a java engineer, you must master the basic skills of JDK and Maven installation and configuration. Although it is not difficult, you must always keep in mind that after all, changing the development environment requires a deployment machine. It is hereby organized and recorded for emergencies.

1 JDK installation and configuration
1 Download JDK Go
to Oracle official website to download JDK ( https://www.oracle.com/java/technologies/javase-downloads.html )
insert image description here
(Figure-1)
2 Install JDK

When installing JDK, in addition to modifying the installation directory, the others can be installed according to the default [Next].

3 Configure environment variables
Click "Start-This Computer (right click)-More-Properties-Advanced System Settings", click "Environment Variables", see the figure below:
insert image description here
(Figure-2)
insert image description here
(Figure-3)
insert image description here
(Figure-4 )

  1. Select "System Variables", New -> Variable Name "JAVA_HOME", variable value "C:\Program Files\Java\jdk1.8.0_221" (that is, the installation path of JDK).
    insert image description here
    (Figure 5)
  2. Edit -> variable name "Path", click "New", then enter "%JAVA_HOME%\bin", click "OK", click "New" again, then enter "%JAVA_HOME%\jre\bin", click Sure.
    insert image description here
    (Figure-6)
    insert image description here
    (Figure-7)

3) New -> variable name "CLASSPATH", variable value ".;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar".

insert image description here
(Figure-8)
4) Test whether the JDK is installed successfully
After configuring the environment variables, enter cmd to check whether Java is installed correctly. The command to check is java -version
insert image description here
(Figure-9)
. As shown in the figure above, the installation is successful.
5) Test whether jre is installed successfully
. After configuring the environment variables, enter cmd to check whether Java is installed correctly. The command to check is javac -version;

insert image description here(Figure-9)

As shown in the figure above, the installation is successful.

2 Maven installation and configuration
1 Maven download (https://maven.apache.org/download.cgi)
insert image description here

2 Unzip, install, and configure system variables

a Configure the MAVEN_HOME
system variable: MAVEN_HOME = D:\app\apache-maven-3.8.1. As shown in the picture:
insert image description here

b Add the path
system variable: path = %MAVEN_HOME%\bin, as shown in the figure:

insert image description here

3 Test whether the installation is successful
Run cmd and enter: mvn -version, as shown in the figure, the configuration is successful. As shown in the picture:
insert image description here

Guess you like

Origin blog.csdn.net/helloworldchina/article/details/119530704