One, jdk1.8 environment installation
2. Create a new java folder under the usr folder
[root@mylinux1 usr]
3. After the decompression is completed, transfer the jdk file to the java directory
[root@mylinux1 java]
jdk1.8.0_361
2. Configuration environment (emphasis)
[root@mylinux1 java]
1. Press i to edit, add the following information at the end
export JAVA_HOME=/usr/java/jdk1.8.0_361
export JRE_HOME=${
JAVA_HOME}/jre
export CLASSPATH=.:${
JAVA_HOME}/lib:${
JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${
JAVA_HOME}/bin:${
JRE_HOME}/bin
export PATH=$PATH:${
JAVA_PATH}
2. Press esc to exit editing, then press shift + : to display, then press wq! to save and exit
3. Execute the following command to refresh and make the configuration file take effect
[root@mylinux1 java]
4. Check whether the configuration information is modified successfully
[root@mylinux1 java]
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/apache-maven-3.9.1/bin:/root/bin:/usr/local/apache-maven-3.9.1/bin:/usr/java/jdk1.8.0_361/bin:/usr/java/jdk1.8.0_361/jre/bin
5. Enter java -version to display information
[root@mylinux1 java]
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)
3. If the following error occurs
[root@mylinux1 java]
-bash: /usr/java/jdk1.8.0_361/bin/java: 权限不够
1. Solution:
[root@mylinux1 jdk1.8.0_361]
4. Uninstall
1. First check whether JDK is installed
[root@mylinux1 java]
2. View the installation path
[root@mylinux1 java]
/usr/java/jdk1.8.0_361/bin/java
3. Uninstall: delete the folder above the bin directory
[root@mylinux1 java]
4. Delete the configuration of environment variables and remove the previously configured information
[root@mylinux1 java]
Five, Maven environment installation
[root@mylinux1 local]
2. Put the decompressed package in the /usr/local directory
[root@mylinux1 local]
apache-maven-3.9.1 bin etc games include lib lib64 libexec sbin share src
3. Enter /etc/profile, edit the following command
[root@mylinux1 usr]
export MAVEN_HOME=/usr/local/apache-maven-3.9.1
export PATH=$PATH:$MAVEN_HOME/bin
4. Let resources take effect
[root@mylinux1 usr]
5. Check whether the configuration is normal
[root@mylinux1 usr]
Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
Maven home: /usr/local/apache-maven-3.9.1
Java version: 1.8.0_361, vendor: Oracle Corporation, runtime: /usr/java/jdk1.8.0_361/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.el7.x86_64", arch: "amd64", family: "unix"