The installation process of JDK1.8 under Linux

Preface
In fact, compared to Windows, the installation of JDK under Linux is simpler.

Step 1: Download and upload from the official website

  1. download

Address: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Download the latest version 8u212 of version 1.8, size 185M
download
Note: If you click now and find that you cannot download, it is not because There is a fee, but you need to log in to an Oracle account. This is free, just register an account with your own email address, and then log in to download

  1. upload

Create a java folder in the /usr/local/ directory, upload the downloaded JDK installation package to this directory, and then decompress it

tar -zxvf jdk-8u212-linux-x64.tar.gz

After decompression:
Table of contents

Step 2: Configuration

Edit the profile file under etc

[root@localhost java]# vi /etc/profile

Exit and save after appending the following configuration:

export JAVA_HOME=/usr/local/java/jdk1.8.0_212
export CLASSPATH=$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH

Environment configuration
Revalidate the configuration file

[root@localhost java]# source /etc/profile

Step Three: Test

Same as the verification under Windows: you can directly input java, javac, java -version

[root@localhost java]# java -version

insert image description here
At this point, the installation is complete, it is still very simple, and the speed is also very fast.

Guess you like

Origin blog.csdn.net/qq_36737803/article/details/93895093