1.安装jdk
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html#license-lightbox
rpm -ivh jdk-8u251-linux-x64.rpm
2.设置环境变量
vi ~/.bashrc
export JAVA_HOME=/usr/java/jdk1.8.0_251-amd64
export JRE_HOME=JAVA_HOME/lib:CLASSPATH
export PATH=JRE_HOME/bin:$PATH
source ~/.bashrc
3.验证:
java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
4.修改权限
chown -R userDev:userDev /mnt/
chmod 755 /mnt/
网友评论