CentOS 6.9 installation jdk1.8

1. Upload source package

  First, the official website to download the installation package: jdk-8u172-linux-i586.tar.gz, upload it to the / opt directory for Linux

2.JDK1.8 installation

  1) Using tar -xf jdk-8u172-linux-i586.tar.gz, extract the source packet

  2) Set jdk environment variables, global setting method used here, is to modify vi etc / profile, it is common to all the user environment variables, as follows:

 JAVA_HOME=/opt/jdk1.8.0_172
 JRE_HOME=/opt/jdk1.8.0_172/jre
 CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/tools.jar
 PATH=$JAVA_HOME/bin:$PATH
 export PATH JAVA_HOME CLASSPATH

  3). The environment variables to take effect, the implementation of source / etc / profile

3. Verify the installation

  Enter java, have returned results represent successful installation, if it returns an error: -bash: /opt/jdk1.8.0_172/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Because the 64-bit system in the installation program 32, the solution: yum install glibc.i686
  Re-enter java, javac, java -version returns results were normal

 

 

    

Guess you like

Origin www.cnblogs.com/pan-louis/p/11184077.html