In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to install jdk1.8 in CentOS6.5". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Prepare the source package:
First download jdk-8u45-linux-x64.gz from the official website.
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. Decompress the source package
2.1 create a new java folder under the / usr/ directory through the terminal, and command line:
Mkdir / usr/java
2.2 then go to the java directory, command line:
Cd / usr/java
Download the jdk-8u45-linux-x64.gz file to the / usr/local/java directory.
2.4 extract the package, command line:
Tar-zxvf jdk-8u45-linux-x64.gz
You can then delete the package, on the command line:
Rm-f jdk-8u45-linux-x64.gz
3. Set the jdk environment variable
The global setting method is used here, which is to modify the etc/profile, which is a common environment variable for all users.
[root@hadoop000 bin] # vi / etc/profile
After opening it, add the following configuration at the end:
Export JAVA_HOME=/usr/java/jdk1.8.0_45 export PAHT=$JAVA_HOME/bin:$PATH
To make the environment variable effective:
Source / etc/profile
See if everything is configured correctly:
[root@hadoop000 bin] # echo $JAVA_HOME / usr/java/jdk1.8.0_45
4. Verify whether the installation is successful
[root@hadoop000 bin] # java-versionjava version "1.8.0mm 45" Java (TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot (TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
5. If the version of the configuration is not displayed, you need to modify the default JDK
Use the following command to modify the default JDK:
Update-alternatives-install / usr/bin/java java/ usr/java/jdk1.8.0_45/bin/java 300 update-alternatives-config java
After the configuration, you will still use the 1.7.0v45 version:
[root@hadoop000 bin] # java-version java version "1.7.0mm 45" OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15) OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
Modify the version of JDK to 1.8.0: 45:
[root@hadoop000 bin] # update-alternatives-- install / usr/bin/java java/ usr/java/jdk1.8.0_45/bin/java 300 [root@hadoop000 bin] # update-alternatives-- config java There are 3 programs which provide 'java'. Selection Command-* 1 / usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java + 2 / usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java 3 / usr/java/jdk1.8.0_45/bin/java Enter to keep the current selection [+] Or type selection number: 3 [root@hadoop000 bin] # java-version java version "1.8.0mm 45" Java (TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot (TM) 64-Bit Server VM (build 25.45-b02, mixed mode) "CentOS6.5 how to install jdk1.8" ends here Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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: 212
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.