Linux下JDK安装和环境变量配置

1.创建目录/opt/apps

mkdir /opt/apps

2.将jdk-8u221-linux-x64.rpm上传apps下
3.安装jdk

rpm -ivh jdk-8u221-linux-x64.rpm

4.修改环境变量

vim /etc/profile

export JAVA_HOME=/usr/java/default
export PATH=$PATH:$JAVA_HOME/bin

source /etc/profile

测试

[root@node1 apps]# java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

上一篇:Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci


下一篇:Idea编译器Spring Profile与Maven Profile联动