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

Nginx reverse proxy learning example tutorial

Table of contents 1. Reverse proxy preparation 1....

MySQL Optimization: Cache Optimization (Continued)

There are caches everywhere inside MySQL. When I ...

8 JS reduce usage examples and reduce operation methods

reduce method is an array iteration method. Unlik...

Detailed explanation of the usage and difference between nohup and & in Linux

Example: We use the Python code loop_hello.py as ...

How to use Celery and Docker to handle periodic tasks in Django

As you build and scale your Django applications, ...

Detailed explanation of daily_routine example code in Linux

First look at the example code: #/bin/bash cal da...

Deeply understand how nginx achieves high performance and scalability

The overall architecture of NGINX is characterize...

25 Vue Tips You Must Know

Table of contents 1. Limit props to type lists 2....

How to create users and manage permissions in MySQL

1. How to create a user and password 1. Enter the...

Docker Basics

Preface: Docker is an open source application con...

Summary of MySQL data migration

Table of contents Preface: 1. About data migratio...