x64安装

mkdir -p /usr/java
cd /usr/java
yum install wget
wget https://download.oracle.com/java/20/latest/jdk-20_linux-x64_bin.rpm
rpm -ivh jdk-20_linux-x64_bin.rpm
java -version
sed -i '/JAVA_HOME/d' /etc/profile
sed -i '$a \export JAVA_HOME=/\usr/java/jdk-20' /etc/profile
sed -i '$a \export PATH=\$JAVA_HOME/bin:\$PATH' /etc/profile
source /etc/profile
echo $JAVA_HOME

arm安装

mkdir -p /usr/java
cd /usr/java
yum install wget
wget https://download.oracle.com/java/20/latest/jdk-20_linux-aarch64_bin.rpm
rpm -ivh jdk-20_linux-x64_bin.rpm
java -version
sed -i '/JAVA_HOME/d' /etc/profile
sed -i '$a \export JAVA_HOME=/\usr/java/jdk-20' /etc/profile
sed -i '$a \export PATH=\$JAVA_HOME/bin:\$PATH' /etc/profile
source /etc/profile
echo $JAVA_HOME
最后修改:2023 年 08 月 24 日
如果觉得我的文章对你有用,请随意赞赏