In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Check the jdk version and uninstall the openjdk version (the difference between jdk and openjdk will not be repeated here)
First check the java-version, javac-version commands to see the version (see figure 1)
Check that the jdk version is 1.7.0.45; then enter rpm-qa | grep java to view (see figure 2)
Note: different CentOS versions may have different openjdk versions; if there is no list, you can go directly to step 4.
Uninstall the above three files (root permission is required, login root permission is uninstalled) (see figure 3)
Rpm-e-nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64rpm-e-nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64rpm-e-- nodeps tzdata-java-2013g-1.el6.noarch
Check the jdk information again (figure 4)
Now you are ready to install the Oracle version of jdk.
Or direct command to download:
[root@VM_16_4_centos home] # wget-no-check-certificate-no-cookies-header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz
Extract jdk, extract command: tar-xvzf jdk-7u25-linux-x64.tar.gz
Location of jdk: / home/codebrother/jdk/jdk-7u25-linux-x64.tar.gz. After the current path is decompressed and decompressed, the jdk folder will appear, enter the jdk directory, and view the contents of the directory (figure 5)
Configure jdk environment variables
On Linux systems, you need to add jdk's bin directory to PATH, create CLASSPATH, and add jdk's lib directory.
Home directory of Jdk: / home/codebrother/jdk/jdk1.7.0_25
Bin directory of jdk: / home/codebrother/jdk/jdk1.7.0_25/bin
Lib directory of jdk: / home/codebrother/jdk/jdk1.7.0_25/lib
Edit ~ / .bashrc file
Command:
Vi / .bashrc
Add the following variables (figure 6)
Export JAVA_HOME=/home/codebrother/jdk/jdk1.7.0_25export JAVA_BIN=$JAVA_HOME/binexport JAVA_LIB=$JAVA_HOME/libexport CLASSPATH=.:$JAVA_LIB/tools.jar:$JAVA_LIB/dt.jarexport PATH=$JAVA_BIN:$PATH
Press the ESC key, then: wq save exit
To make the jdk environment variable effective, source ~ / .bashrc (figure 7)
View jdk version
Enter java-version, javac-version (figure 8)
Summary
The above is the method of configuring JDK environment variables under ubuntu introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!
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.
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.