Linux JDK安装及配置 (tar.gz版)

来自ling
跳转至: 导航搜索

http://jingyan.baidu.com/article/ab0b56308966acc15afa7d18.html

oracle jdk

yum -y install wget

下载并解压在/etc/java

cd /alidata/soft
wget http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
rz 上传
mkdir -p  /etc/java
cd /etc/java
tar -xvzf /alidata/soft/jdk-8u121-linux-x64.tar.gz
vi ~/.bashrc

配置 .bashrc后面

export JAVA_HOME=/etc/java/jdk1.8.0_121
export JAVA_BIN=$JAVA_HOME/bin
export JAVA_LIB=$JAVA_HOME/lib
export CLASSPATH=.:$JAVA_LIB/tools.jar:$JAVA_LIB/dt.jar
export PATH=$JAVA_BIN:$PATH

使生效

source ~/.bashrc