JDK有rpm安装包,也有tar.gz的安装包
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
rpm包安装:rpm -ivh jdk-8u241-linux-x64.rpm
tar.gz包安装:直接解压即可;
配置环境变量,在/etc/profile文件最后加上:
export JAVA_HOME=/usr/local/jdk1.8.0_241
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
然后执行 source /etc/profile 让配置生效,不执行则配置不会生效;
打印环境变量:echo $PATH
标签:JAVA,jdk,安装,export,PATH,HOME,rpm,环境变量 From: https://www.cnblogs.com/healthinfo/p/17075658.html