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

A brief talk about JavaScript Sandbox

Preface: Speaking of sandboxes, our minds may ref...

Summary of commonly used tool functions in Vue projects

Table of contents Preface 1. Custom focus command...

Summary of methods for finding and deleting duplicate data in MySQL tables

Sometimes we save a lot of duplicate data in the ...

Summary of how to add root permissions to users in Linux

1. Add a user . First, use the adduser command to...

Django uses pillow to simply set up verification code function (python)

1. Import the module and define a validation stat...

Summary of four situations of joint query between two tables in Mysql

Generally speaking, in order to get more complete...

Linux gzip command compression file implementation principle and code examples

gzip is a command often used in Linux systems to ...

js uses Canvas to merge multiple pictures into one implementation code

Solution function mergeImgs(list) { const imgDom ...

How to use JavaScript to implement sorting algorithms

Table of contents Bubble Sort Selection Sort Inse...

Docker installation and configuration steps for Redis image

Table of contents Preface environment Install Cre...

Detailed explanation of the wonderful CSS attribute MASK

This article will introduce a very interesting at...

Detailed tutorial on installing MySQL 5.7.20 on RedHat 6.5/CentOS 6.5

Download the rpm installation package MySQL offic...