moneyslow.com

ubuntu22.04安装jdk8(jdk1.8)步骤

ubuntu小技巧

ubuntu小技巧

#apt-get install openjdk-8-jdk

# which java
/usr/bin/java

#readlink -f /usr/bin/java
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
去掉后面的/bin/java,设置环境变量:

echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre' >> /etc/profile
echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile
source /etc/profile

# java -version
openjdk version "1.8.0_412"
Exit mobile version