Server Ubuntu 22.04 64-bit installation jdk1.8 operation manual

1. Download the jdk installation package corresponding to the system from the Oracle official website:

JDK download address

2. Decompress

First create a directory /usr/local/jdk/

sudo tar -xzvf  jdk-8u341-linux-x64.tar.gz -C /usr/local/jdk/

3. After unzipping to this directory, configure the java environment

sudo vim ~/.bashrc
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_341
export JRE_HOME=${
    
    JAVA_HOME}/jre
export CLASSPATH=.:JAVA_HOME/lib:JRE_HOME/lib:${
    
    CLASSPATH}
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

4. Check whether the installation is successful

java -version

Guess you like

Origin blog.csdn.net/weixin_45500785/article/details/129402677