This article demonstrates how to install openjdk on CentOS7.
$ yum -y list java-1.8*
# List currently available installation versions
Available Packages
java-1.8.0-openjdk.i686 1:1.8.0.171-7.b10.el7 updates
java-1.8.0-openjdk.x86_64 1:1.8.0.171-7.b10.el7 updates
............
java-1.8.0-openjdk-devel.i686 1:1.8.0.171-7.b10.el7 updates
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.171-7.b10.el7 updates
java-1.8.0-openjdk-devel-debug.i686 1:1.8.0.171-7.b10.el7 updates
java-1.8.0-openjdk-devel-debug.x86_64 1:1.8.0.171-7.b10.el7 updates
For example: java-1.8.0-openjdk
$ yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
$ rpm -ql java-1.8.0-openjdk
$ vi /etc/profile
# Add the following at the end of the file
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.****export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
$ source /etc/profile
$ java -version
If the installation is successful, it will display:
openjdk version "1.8.0_161"
OpenJDK Runtime Environment(build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM(build 25.161-b14, mixed mode)
**Remarks: ** Installing openjdk, when using the encryption and decryption functions of Jhipster-Registry, will simplify a little work, I will sort out the instructions in related articles.
Recommended Posts