Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Dependencies

On CentOS 7.6/openEuler 20.03

  1. Install dependencies.
    1
    yum install java-1.8.0-openjdk-* tcl git gcc gcc-c++ make cmake libtool autoconf automake wget -y
    

    If an error message is displayed stating "Error: GPG check FAILED" during the installation, run the following command to install the dependencies:

    yum install java-1.8.0-openjdk-* tcl git gcc gcc-c++ make cmake libtool autoconf automake --nogpgcheck -y
  2. Configure Java.
    1. View the Java installation directory.
      find /usr/lib/jvm/  -name java
      Alternatively,
      find / -name java
      Alternatively,
      which java
      • CentOS:
        ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.aarch64/bin/java
      • openEuler:
        ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-7.oe1.aarch64/bin/java
    2. Configure the environment variables: JAVA_HOME, JRE_HOME, CLASSPATH, and PATH.
      1. Open the profile file.
        vim /etc/profile
      2. Press i to enter the insert mode and add the content of the corresponding OS to the profile file.
        • CentOS:
          export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.aarch64
          export JRE_HOME=$JAVA_HOME/jre
          export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
          export PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.aarch64/bin:$PATH
        • openEuler:
          export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-7.oe1.aarch64
          export JRE_HOME=$JAVA_HOME/jre
          export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
          export PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-7.oe1.aarch64/bin:$PATH
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Make the environment variables take effect.
      source /etc/profile
    5. View the environment variables.
      echo $JAVA_HOME
      echo $JRE_HOME
      echo $CLASSPATH
      echo $PATH
      • CentOS:

      • openEuler:

    6. View the Java version.
      java -version
      • CentOS:

      • openEuler:

On CentOS 8.1

  1. Download and install the dependencies.
    yum install tcl git wget gcc gcc-c++ make cmake libtool autoconf automake java-1.8.0* -y
  2. Check the Java version. If the Java version is displayed, Java is successfully installed.
    java -version