Linux system (Centos6.5 and above) installation jdk tutorial analysis

Linux system (Centos6.5 and above) installation jdk tutorial analysis

Article Structure

  • 1. Preparation
  • 2. Install Java JDK8.0
  • 3. Configure environment variables
  • 3. Verify that the installation is successful
  • 5. Uninstall Java JDK

1. Preparation

①, Java JDK distinguishes between 32-bit and 64-bit systems. Before installing, check the version number of the Centos system through the command, specifically check the command: #uname -a

Explanation: If there is x86_64, it is 64-bit, if not, it is 32-bit. If it is followed by X686 or X86_64, the kernel is 64-bit, and if it is i686 or i386, the kernel is 32-bit.

As shown in the figure:

insert image description here

②, Download JDK, here the editor provides you with the following address: JKD download address, click to go directly

insert image description here

③. The software and system required for the operation are as follows: virtual machine (Vmware), Centos system installed in the virtual machine, Xshell, Xftp, jdk-8u65-linux-i586.gz

2. Install JDK

① After the above preparations, we now have an environment where we can install JDK.

②, then use the command in Xshell to jump to the folder created under local: javaweb

③, execute the command cd usr/local/ mkdir jdk cd jdk/

④, then upload the jdk installation package to the javaweb directory through the FileZilla FTP Client software

⑤, Unzip the uploaded jdk installation package. If you want to delete the installation package, you can execute the 5.2 command as follows,

5.1 tar -zxv -f jdk-8u65-linux-i586.gz

5.2 rm -rf jdk-8u65-linux-i586.gz

5.3 Results as shown in the figure:

insert image description here

⑥. Through the above steps, our JDK has been fully installed. The next step is more important: configure environment variables

3. Configure JDK environment variables

①, vim /etc/profile

1.2 After opening, press the keyboard (i) to enter the editing mode, and copy the following content to the bottom. Note (JAVA_HOME must be the directory where your JDK is installed. If it is not, please check it, otherwise the configuration will fail!)

JAVA_HOME=/usr/local/jdk/jdk1.8.0_192
       PATH=$JAVA_HOME/bin:$PATH
       CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
       export PATH JAVA_HOME CLASSPATH

Note: According to the above configuration information, we can complete the configuration of environment variables. It should be noted that when configuring PATH, AVA_HOME/bin must be placed first. Otherwise, when using the java command, the system will find the previous JAVA and will not look for it further. In this way, the directory where the java executable file runs is not actually in $JAVA_HOME/bin, but in other directories, which will cause big problems.

1.3 After writing, we press the keyboard (ESC) button to exit, then press (:wq) to save and close Vim.

②. After the configuration is completed, the most important step is to make the file take effect immediately: command such as: source /etc/profile

4. Verify that JDK is installed successfully

①. After completing all the above steps, we need to check whether the installation is successful. Enter the following command, as shown in the figure:

1.1 java -version

1.2 echo $JAVA_HOME

1.3, as shown in the figure:

insert image description here

5. Uninstall JDK

①, First execute the command to check the version of jdk on the server: The command is as follows: rpm -qa|grep jdk

②, then execute the command: yum -y remove java java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64

Simply delete each version found above.

End of article

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox
  • Graphical tutorial on installing JDK1.8 under CentOS7.4
  • Install JDK8 in rpm mode on CentOS7
  • Detailed tutorial on installing JDK8 on Linux system (CentOS7 installation)
  • CentOS8 installation tutorial of jdk8 / java8 (recommended)
  • Tutorial on deploying jdk and tomcat on centos7 without interface
  • Linux centOS installation JDK and Tomcat tutorial
  • Centos installation jdk case explanation

<<:  Mysql join query syntax and examples

>>:  Detailed explanation of the difference between routing hooks in Vue2.x and Vue3.x

Recommend

Detailed explanation of Shell script control docker container startup order

1. Problems encountered In the process of distrib...

Node.js sends emails based on STMP protocol and EWS protocol

Table of contents 1 Node.js method of sending ema...

mysql5.7.18 decompressed version to start mysql service

The decompressed version of mysql5.7.18 starts th...

Learn more about MySQL indexes

1. Indexing principle Indexes are used to quickly...

Detailed explanation of MySQL 8.0 password expiration policy

Starting from MySQL 8.0.16, you can set a passwor...

SQL implementation LeetCode (176. Second highest salary)

[LeetCode] 176. Second Highest Salary Write a SQL...

How to use squid to build a proxy server for http and https

When we introduced nginx, we also used nginx to s...

A brief discussion on the lazy loading attribute pattern in JavaScript

Table of contents 1. Introduction 2. On-demand at...

JavaScript setTimeout and setTimeinterval use cases explained

Both methods can be used to execute a piece of ja...

JavaScript typing game

This article shares the specific code of JavaScri...

js to achieve image fade-in and fade-out effect

This article shares the specific code of js to ac...

Detailed explanation of Linux index node inode

1. Introduction to inode To understand inode, we ...

A brief discussion on the semantics of HTML and some simple optimizations

1. What is semanticization? Explanation of Bing D...