centos7- extracting installation java1.8 / jdk1.8

centos7- extracting installation java1.8 / jdk1.8

background:

Development needs java environment, centos built openjdk, but the kind of uncontrolled feeling very bad, I personally prefer the custom.

He said that, java environment is very simple to install, can be installed directly through yum command, did not say in detail here, I'm a programmer, I prefer the kind of java environment like windows in a folder

In bash input which javacan see the path /usr/binunder, /usr/binunder a lot of executable command file, java environment in this way is really disgusting. So I deleted this openjdk the compressed file is installed directly from the official website.

step

  1. Obtain official website files, get into the oracle official website

  2. Extracting tar -zxvf ****

  3. Move into their specified path, people like to install /usr/local

    mv ****  /usr/local/java
    
  4. Configuration environment variable vi / etc / profile

    #set java environment
    #JAVA_HOME自己的安装的路径
    JAVA_HOME=/usr/local/java
    JRE_HOME=$JAVA_HOME/jre
    PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
    CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
    export JAVA_HOME JRE_HOME PATH CLASSPATH
    
  5. carry out

Reproduced in: https: //my.oschina.net/suveng/blog/3056704

Guess you like

Origin blog.csdn.net/weixin_34293246/article/details/91857977