Ubuntu 18.04LTS installation configuration Java OpenJDK8

Installation OpenJDK8

sudo apt-get install openjdk-8-jdk

Configuring the Java environment variable

sudo vim /etc/profile
Add the following to the end of the profile:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

   
   

After adding save and exit, use java -versionto check whether success

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

   
   

Reference: Ubuntu install JDK configuration environment variable

Original Address: https: //blog.csdn.net/EahanZhang/article/details/88085561

Guess you like

Origin www.cnblogs.com/jpfss/p/11106315.html