Centos配置Oracle JAVA环境
- 下载JAVA jdk的安装包
下载地址: https://www.oracle.com/java/technologies/downloads/
# pwd
/usr/local/src
- 解压安装包
解压二进制文件并设置软连接
# tar -xvf jdk-8u241-linux-x64.tar.gz
# ln -sv /usr/local/src/jdk1.8.0_241 /usr/local/jdk
- 配置环境变量
# vim /etc/profile
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar
- 加载配置文件
source /etc/profile
- 验证JAVA版本
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
- Centos安装openjdk
yum search java|grep jdk
yum install java-11-openjdk.x86_64
java -version
我们一直奔跑在进步的旅途