CentOS 7 installation and configuration jdk-8u162
I recently learned JavaWeb and decided to record a series of Linux configurations.
This document records the process of installing and configuring the jdk-8u162 under CentOS 7.
1. Download The jdk-8u162 version
Link: Official Address
Ii. Upload jdk to centos
3. Check whether jdk is available on the current linux system. linux Command: rpm-qa | grep java
Query results:
Uninstall the built-in jdk (arrow mark). Command: rpm-e -- the jdk name that comes with nodeps
For example, detach the first: rpm-e -- nodeps java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.x86_64
4. Continue to install and create/usr/local/java. Run the command mkdir-p/usr/local/java.
5. Decompress jdk to the java directory and run the command tar-zxvf/usr/local/jdk-8u162-linux-x64.tar.gz-C/usr/local/java.
Here I am using an absolute path. You can also enter a specific directory and use a relative path for operations.
Go to the directory: cd/usr/local
Use the ll command to view the current directory
6. Go to the java folder and run the command cd java and ll to view the current folder.
7. Configure the java environment variable: Command: vim/etc/profile. The result is as follows:
8. Press I to enter the insert mode. Add the following at the bottom of the configuration file:
Export JAVA_HOME =/usr/local/java/jdk1.8.0 _ 162
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
Press esc to exit the insert mode, and then enter wq to save the current modification. After saving the modification, enter source/etc/profile to make the configuration environment take effect.
9. Enter java in the console to test the jdk Installation
Enter java-version to view the current jdk version.
At this point, the installation and configuration are successful. If there are errors, please point out, thank you.
Configure JDK environment variable https://www.bkjia.com/Linux/2017-01/139212.htm under Linux Virtual Machine
Install JDK 1.8 https://www.bkjia.com/Linux/2016-12/138940tm on Ubuntu
CentOS7 configure custom JDK https://www.bkjia.com/Linux/2017-06/144979.htm
Ubuntu 16.04 LTS configuration JDK1.8 problems and solve notes https://www.bkjia.com/Linux/2017-02/140138.htm
Easy to understand on CentOS 6.7 install JDK getting started tutorial https://www.bkjia.com/Linux/2017-12/149877.htm
This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151326.htm