Linux installation jdk (two ways)

Recent big thing in terms of research data, the business scenario is a device to collect data from processed and stored DB.

file

The first step in building the above environment must be installed jdk, so everyone together to learn about the basics of centos7.5 installation jdk1.8.

Jdk installed in two ways: manual installation yum installation. Installation yum follows:

1, the query version you want to install the jdk:

命令:yum -y list java*

file

2, installation jdk1.8

命令:yum install -y java-1.8.0-openjdk.x86_64

3, the query jdk version

命令:java -version

This installation was successful. Default to install usr / lib / jvm / obsessive-compulsive disorder, I certainly can not let them install it here.

Manual installation as follows:

1, go to the official website to find jdk1.8: point I quickly enter the official website

file

Download now need oracle account. You will jump directly login page.

file

There is no need to register an account at the oracle account.

file

First registration required mailbox activate it.

file

Then you can log in directly using the email + password. Can be downloaded directly after logging done!

file

2, let him slowly download, we go to create a folder:

file

  1.  
    Into the DATA directory (I use the DATA directory):
  2.  
    Command: cd DATA
  3.  
    Create a folder jdk
  4.  
    Command: mkdir the JDK

file

And then quietly wait after downloading.

file

3, server upload: fileUpload Complete: ll jdk directory in the inquiry aboutfile

4, extract jdk:

file

在jdk目录下解压: 命令:tar -zxvf jdk-8u211-linux-x64.tar.gz(jdk-8..这个是刚下载的jdk名称)

5, decompression success:

file

6, configure the environment variables:

命令: vim /etc/profile

file

7, configure the environment variable Code:

file

把以下命令放到环境变量 export JAVA_HOME=/DATA/jdk/jdk1.8.0_211 export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/ export PATH=$PATH:$JAVA_HOME/bin

file

8, refreshing environment variable file: 刷新环境变量命令:source /etc/profile file

9 to see if the installation was successful: 查询jdk版本命令: java -version file

Reprinted https://blog.csdn.net/weixin_39984161/article/details/91447727

Guess you like

Origin www.cnblogs.com/gaodi2345/p/11707559.html