一、开发环境配置
1. 下载JDK
下载地址: https://www.oracle.com/java/technologies/javase-downloads.html
2. 解压
$ cd $HOME/software
$ tar zxf jdk-8u231-linux-x64.tar.gz
3. 配置环境变量
$ cat >> $HOME/.bashrc << 'EOF'
JAVA_HOME=$HOME/software/jdk1.8.0_231
JRE_HOME=$JAVA_HOME/jre
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
EOF
4.验证是否生效
$ source $HOME/.bashrc
$ java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
|