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 the use of Linux seq command

01. Command Overview The seq command is used to g...

Use javascript to create dynamic QQ registration page

Table of contents 1. Introduction 1. Basic layout...

How to compile the Linux kernel

1. Download the required kernel version 2. Upload...

MySQL query learning basic query operations

Preface MySQL is the most popular relational data...

React High-Order Component HOC Usage Summary

One sentence to introduce HOC What is a higher-or...

About MySQL 8.0.13 zip package installation method

MySQL 8.0.13 has a data folder by default. This f...

Docker image cannot be deleted Error: No such image: xxxxxx solution

Preface The docker image cannot be deleted. Check...

Analysis of the principle and usage of MySQL continuous aggregation

This article uses examples to illustrate the prin...

How to set up a shared folder on a vmware16 virtual machine

1. Set up a shared folder on the virtual machine:...

DOCTYPE Document Type Declaration (Must-Read for Web Page Lovers)

DOCTYPE DECLARATION At the top of every page you w...

Docker-compose steps to configure the spring environment

Recently, I need to package the project for membe...

Detailed explanation of the implementation of shared modules in Angular projects

Table of contents 1. Shared CommonModule 2. Share...

Open the app on the h5 side in vue (determine whether it is Android or Apple)

1. Development environment vue+vant 2. Computer s...

How to use node to implement static file caching

Table of contents cache Cache location classifica...

JavaScript implementation of verification code case

This article shares the specific code for JavaScr...