Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install offline JDK1.8 in centos7.0

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to install offline JDK1.8 in centos7.0. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

View the java repository version

Yum list | grep java

View the installed version of java jdk

Rpm-qa | grep java

If no message is displayed, the jdk version is not installed.

If the following message is displayed:

Rpm-qa | grep jdkjava-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

The Java command is not recognized after the uninstall 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

Extract to the installation directory

The current version is jdk1.8.172

Jdk-8u172-linux-x64.gz

Set up the installation directory

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

Add writeable permissions

Chmod-v USBW / etc/sudoers

Then edit the / etc/sudoers file

Vi / etc/sudoers

Add the following hadoop code:

Allow root to run any commands anywhereroot ALL= (ALL) ALL hadoop ALL= (ALL) ALL # this is new add user / /-ls-l / etc/sudoers

Remove writeable permissions

Chmod-v Umurw / etc/sudoers sudo-u hadoop sudo cat / etc/passwd

The hadoop user is now a user with sudo privileges.

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

Change the directory name

Mv jdk1.8.0_172/ jdk1.8/

Go to 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)

Configuration of jdk

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

Vi / etc/profile

At the end of the profile file, add:

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

Jdk configuration verification

Enable the profile first

Source / etc/profile [root@hadoop-localhost jdk1.8] # source / etc/profilejava-version [root@hadoop-localhost jdk1.8] # java-version java version "1.8.0x172" Java (TM) SE Runtime Environment (build 1.8.0_172-b11) Java HotSpot (TM) 64-Bit Server VM (build 25.172-b11, mixed mode) above is how to install offline JDK1.8 in centos7.0 The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report