Mounting the linux deepin jdk

 

First, install jdk8

 

  • Download the JDK tar.gz package

   Official website to download the latest JDK:

          http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  • Extracting archive

     Download directory

    cd ~/Download

    Unzip tar.gz package

   tar -zxvf jdk-8u171-linux-x64.tar.gz

   Install the JDK

   sudo mv jdk-8u171-linux-x64/  /usr/lib/jvm/jdk1.8.0_171

 

JDK environment variable configuration

  • Modify the configuration file
    sudo vim /etc/profile

Increase content at the end of the file

  1.  export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_171
  2.  export JRE_HOME=${JAVA_HOME}/jre
  3.  export CLASSPATH=.:${JAVA_HOME}/lib:${JAVA_HOME}/lib
  4.  export PATH=${JAVA_HOME}/bin:$PATH

Note that the path and version of jdk

  • Validate the configuration
source /etc/profile

test

  • View JAVA version

In the terminal execute the following command

java -version

Export

  1.  
    java version "1.8.0_171"
  2.  
    Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
  3.  
    Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

 

In the terminal on the implementation of java and javac commands have the correct feedback, the installation is successful, it ended.

Guess you like

Origin www.cnblogs.com/ladder/p/10991796.html