我要评分
获取效率
正确性
完整性
易理解

Installing JDK 8

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Go to the installation directory.
    cd /path/to/JDK8
  3. Decompress the package.
    tar -zxvf jdk-8u341-linux-aarch64.tar.gz
  4. Set the environment variables.
    vim ~/.bashrc

    Add the following content to the end of the .bashrc file:

    #set java environment
    JAVA_HOME=/path/to/JDK8/jdk1.8.0_341/
    JRE_HOME=/path/to/JDK8/jdk1.8.0_341/jre
    CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
    PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
    export JAVA_HOME JRE_HOME CLASS_PATH PATH

    Make the environment variables take effect.

    source ~/.bashrc
  5. Perform the verification.
    java -version