Installing Dependencies
- Download and install the dependencies.
- On CentOS 7.6/openEuler 20.03:
1yum install java-1.8.0-openjdk-* tcl git gcc gcc-c++ make cmake libtool autoconf automake -y
- On CentOS 8.1:
yum install -y java-1.8.0* tcl git wget gcc gcc-c++ make cmake libtool autoconf automake python2 python2-devel java-11-openjdk-devel
- On CentOS 7.6/openEuler 20.03:
- Configure Java. (Skip this step on CentOS 8.1.)
- View the Java installation directory.
find /usr/lib/jvm/ -name java
Orfind / -name java
Orwhich java
- On CentOS 7.6:
ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.aarch64/bin/java
- On openEuler 20.03:
ls /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-7.oe1.aarch64/bin/java
- On CentOS 7.6:
- Configure the environment variables: JAVA_HOME, JRE_HOME, CLASSPATH, and PATH.
- Open the profile file.
vim /etc/profile
- Press i to enter the insert mode and add the content of the corresponding OS to the profile file.
- On 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
- On 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
- On CentOS:
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the profile file.
- Make the environment variables take effect.
source /etc/profile
- View the environment variables.
echo $JAVA_HOME
echo $JRE_HOME
echo $CLASSPATH
echo $PATH
- View the Java installation directory.
- View the Java version.
java -version
Parent topic: Configuring the Compilation Environment