Detailed tutorial on installing JDK1.8 on Linux

Detailed tutorial on installing JDK1.8 on Linux

1. Cleaning before installation

rpm -qa | grep jdk
rpm -qa | grep gcj
yum -y remove java-xxx-xxx

2. Download JDK online

Order:

wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm

Download Reading Strip:

Check whether there is a JDK installation package in the current folder:

Add execute permissions:

Command: chmod +x jdk-8u131-linux-x64.rpm

Execute rpm to install

Command: rpm -ivh jdk-8u131-linux-x64.rpm

Check whether JDK is installed successfully

Command: java -version

Check the installation path of JDK (the default path is /usr/java/jdk1.8.0_131)

Configuring JDK environment variables

1. Edit environment variables

export JAVA_HOME=/usr/java/jdk1.8.0_131
 export JRE_HOME=${JAVA_HOME}/jre
 export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
 export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
 export PATH=$PATH:${JAVA_PATH}

2. Edit /etc/profile

Command: vim /etc/profile

3. Configure the environment

Command: i enters edit mode

Paste the edited

Enter the command: :wq!

Force save and exit

Let the profile take effect immediately:

source /etc/profile

Summarize

The above is a detailed tutorial on how to install JDK1.8 under Linux system introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Linux jdk installation and environment variable configuration tutorial (jdk-8u144-linux-x64.tar.gz)
  • How to install JDK and set environment variables in Linux (this article is enough)
  • How to configure jdk environment under Linux
  • Tutorial on installing jdk1.8 and configuring environment variables under Linux
  • Install JDK1.8 in Linux environment

<<:  Solution to MySql service disappearance for unknown reasons

>>:  javascript countdown prompt box

Recommend

Configure Mysql master-slave service implementation example

Configure Mysql master-slave service implementati...

Summary of basic usage of js array

Preface Arrays are a special kind of object. Ther...

How to remount the data disk after initializing the system disk in Linux

Remount the data disk after initializing the syst...

Command to remove (delete) symbolic link in Linux

You may sometimes need to create or delete symbol...

Summary of MySQL lock knowledge points

The concept of lock ①. Lock, in real life, is a t...

Embed codes for several older players

The players we see on the web pages are nothing m...

jQuery treeview tree structure application

This article example shares the application code ...

Detailed explanation of dynamic Christmas tree through JavaScript

Table of contents 1. Animated Christmas Tree Made...

Centos6.5 glibc upgrade process introduction

Table of contents Scenario Requirements glibc ver...

Example code of layim integrating right-click menu in JavaScript

Table of contents 1. Effect Demonstration 2. Impl...