How to install offline JDK1.8 on centos7.0

View java warehouse version

yum list |grep java

Check the installed java jdk version

rpm -qa | grep java

If no information is displayed, the jdk version has not been installed

If the following information is displayed:

rpm -qa|grep jdk
java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64 
 java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64 
 java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.3.el7.x86_64 
 java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64

Uninstall command

yum -y remove java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64

Java commands are not recognized after uninstallation is complete

java -version

bash: java: command not found…

start installation

Go to the official website to download jdk: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Unzip to the installation directory

The current version is jdk1.8.172

jdk-8u172-linux-x64.gz

Create installation directory

cd home; 
 adduser hadoop; 
 passwd hadoop; 
 whereis sudoers 
 ls -l /etc/sudoers

Add write permission

chmod -v u+w /etc/sudoers

Then edit the /etc/sudoers file

vi /etc/sudoers

Add the following hadoop code:

Allow root to run any commands anywhere
root ALL=(ALL) ALL 
 hadoop ALL=(ALL) ALL #this is newadd user 
 //————————— 
ls -l /etc/sudoers

Remove writable permissions

chmod -v u-w /etc/sudoers 
 sudo -u hadoop 
 sudo cat /etc/passwd

Now the hadoop user is a user with sudo privileges.

tar -zxvf jdk-8u172-linux-x64.gz -C /home/hadoop/java/

Change directory name

mv jdk1.8.0_172/ jdk1.8/

Enter the jdk folder and get the absolute path of the directory

pwd

[ root@hadoop-localhost jdk1.8]# pwd 
 /home/hadoop/java/jdk1.8

(My absolute path is: /home/hadoop/java/jdk1.8)

jdk configuration

Use the vim command to open the system's environment variable configuration file:

vi /etc/profile

Add at the end of the profile file:

//## JAVA export JAVA_HOME=/home/hadoop/java/jdk1.8//The absolute path of jdk (mine is:/home/hadoop/java/jdk1.8)export PATH=PATH: 
PATH:
JAVA_HOME/bin

jdk configuration verification

Enable the configuration file first

source /etc/profile
[ root@hadoop-localhost jdk1.8]# source /etc/profile
java -version
[ root@hadoop-localhost jdk1.8]# java -version 
 java version “1.8.0_172” 
Java(TM) SE Runtime Environment(build 1.8.0_172-b11) 
 Java HotSpot(TM)64-Bit Server VM(build 25.172-b11, mixed mode)

to sum up

The above is the centos7.0 installation offline JDK1.8 method introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message. The editor will reply to you in time. Thank you very much for your support to the ZaLou.Cn website!

Recommended Posts

How to install offline JDK1.8 on centos7.0
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
[Graphic] How to install tomcat on centos
R&D: How To Install Python 3 on CentOS 7
How to install and configure Elasticsearch on CentOS 7
How to install Visual Studio Code on CentOS 8
How to install RPM packages on CentOS Linux
How to install and configure VNC on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install Docker CE on RHEL 8 / CentOS 8
How to install and uninstall tomcat on centos
How to install and configure Redmine on CentOS 8
How to install and configure NFS server on CentOS 8
How to install and use Cockpit on CentOS 8/RHEL 8
How to quickly install docker on Linux (Centos version)
How to install Google Chrome web browser on CentOS 8
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04