Created
November 18, 2017 03:34
-
-
Save fengchangfight/5e8eda5f13ab8bc099e1ab6e3f48bbd3 to your computer and use it in GitHub Desktop.
remove openjdk and install oracle jdk in centos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum list java* | |
sudo yum -y remove java* | |
java -version | |
cd | |
mkdir tmp | |
cd tmp | |
curl -u uftp:uftp ftp://192.168.2.115/path/developer/jdk-8u151-linux-x64.tar.gz -o jdk-8u151-linux-x64.tar.gz | |
tar zxvf jdk-8u151-linux-x64.tar.gz | |
sudo mv jdk1.8.0_151 /usr/share/ | |
sudo vim /etc/profile | |
#add | |
export JAVA_HOME=/usr/share/jdk1.8.0_151 | |
export PATH=$JAVA_HOME/bin:$PATH | |
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar | |
source /etc/profile | |
java -version | |
which java |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment