Linux server download and install JDK


My website:

Related to this article: Download and install Tomcat on Linux server

The first is the download address of jdk8u211:
Linux server download and install JDK

1 check and uninstall openjdk

The first step is to check whether the system comes with openjdk and related installation packages, and if so, uninstall them first.
Check command:

java -version
rpm -qa | grep java

If you find that there is an installed openjdk and the installation package, first perform the uninstall in turn.
Uninstall command:

rpm -e --nodeps tzdata-java-2012c-1.el6.noarch
rpm -e --nodeps java-1.6.0-openjdk-

2 unzip the installation

(how to upload and download files to the server)
After uploading the installation file to the Linux server, enter the directory to decompress and install:

tar -zxvf jdk-7u75-linux-x64.tar.gz 

After decompression, create a new Java directory and move the newly extracted JDK directory to the directory we created:

mkdir /wocloud
mv ./jdk1.8.0_211 /wocloud

3 configure environment variables

(those who are not familiar with VI operation can learn)
After installation, you need to configure the following environment variables and edit the / etc / profile file:

vi /etc/profile

Add the following configuration at the end of the file:

export JAVA_HOME=/wocloud/jdk1.8.0_211
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

The screenshot is as follows:
Linux server download and install JDK

After editing, press ESC and input: WQ save to exit. The last step is to reload the / etc / profile file through the source command, so that the modified content is valid in the current shell window:

source /etc/profile

4 test

inputjava -versionCheck the JDK version information:

As shown in the figure below, the JDK version is displayed normally, and has been installed successfully so far.
Linux server download and install JDK

I have encountered such problems, but I still haven’t solved them after reading the article,
Comment or add QQ: 781378815

Recommended Today

Oracle (PLSQL) introduction 1

Oracle installation, user authorization, table operation, data type, DDL table, DML data. Next: Oracle introduction 2 Learning video: Baidu cloud installation package is attached to the installation tutorial: 40774525/article/details/79919057 Oracle Baidu cloud installation package: Extraction code: 5abz After the Oracle service above is installed, open the client of SQL developer and the […]