Linux Centos 7 configuration jdk

  1. Unzip command: tar -zxvf jdk-8u211-linux-x64.tar.gz

  2. Create a soft link (can be omitted): ln -s jdk1.8.0_211/ jdk_current

  3. Editing system environment variables:vi /etc/profile [A start editing]

  4. Join as follows:

    export JAVA_HOME=/home/ryan/app/jdk_current
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$JAVA_HOME/bin:$PATH
    注意标点符号,JAVA_HOME是jdk的路径
    
  5. Just set the variable load
    source /etc/profile

  6. Test whether the installation is successful
    - then enter java -version displays the version information jdk, etc.
    - input javac javac command will display this help and jdk environment variable configuration succeeded
    [ryan@localhost app]$ java -version
    java version "1.8.0_211"
    Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
    [ryan@localhost app]$ javac -version
    javac 1.8.0_211

  7. Note : each boot must source profile

Published 11 original articles · won praise 11 · views 9994

Guess you like

Origin blog.csdn.net/zh554275855/article/details/89829368