This section describes how to install JDK 8 on CentOS. Software environment CentOS: 6.5, x86-64 version JDK: 8.0, X86-64 bit version, rpm format installation first switch to the root: '''su-root''' and then install jdk: '''rp overview
Record the JDK8 installation process of CentOS.
Software Environment
CentOS: 6.5, X86-64 bit version
JDK: 8.0, X86-64 bit version, rpm format
Install
First switch to root:
'''
Su-root
'''
Then install jdk:
'''
Rpm-ivh jdk-8-linux-x64.rpm
Preparing... ######################################## ### [100%]
1: jdk ####################################### #### [100%]
Unpacking JAR files...
Rt. jar...
Error: cocould not open input file:/usr/java/jdk1.8.0/jre/lib/rt. pack
Error: unpack cocould not create JAR file:
/Usr/java/jdk1.8.0/jre/lib/rt. jar
Please refer to the Troubleshooting section of the Installation Instructions
On the download page.
Jsse. jar...
Error: cocould not open input file:/usr/java/jdk1.8.0/jre/lib/jsse. pack
Error: unpack cocould not create JAR file:
/Usr/java/jdk1.8.0/jre/lib/jsse. jar
Please refer to the Troubleshooting section of the Installation Instructions
On the download page.
Charsets. jar...
Error: cocould not open input file:/usr/java/jdk1.8.0/jre/lib/charsets. pack
Error: unpack cocould not create JAR file:
/Usr/java/jdk1.8.0/jre/lib/charsets. jar
Please refer to the Troubleshooting section of the Installation Instructions
On the download page.
Tools. jar...
Error: cocould not open input file:/usr/java/jdk1.8.0/lib/tools. pack
Error: unpack cocould not create JAR file:
/Usr/java/jdk1.8.0/lib/tools. jar
Please refer to the Troubleshooting section of the Installation Instructions
On the download page.
Localedata. jar...
Error: cocould not open input file:/usr/java/jdk1.8.0/jre/lib/ext/localedata. pack
Error: unpack cocould not create JAR file:
/Usr/java/jdk1.8.0/jre/lib/ext/localedata. jar
Please refer to the Troubleshooting section of the Installation Instructions
On the download page.
Jfxrt. jar...
Error: cocould not open input file:/usr/java/jdk1.8.0/jre/lib/ext/jfxrt. pack
Error: unpack cocould not create JAR file:
/Usr/java/jdk1.8.0/jre/lib/ext/jfxrt. jar
Please refer to the Troubleshooting section of the Installation Instructions
On the download page.
'''
The above error occurs because another JDK Version already exists in the system. use 'rpm-qa | grep jdk' to query the existing jdk and run the 'rpm-E' command to remove it. Then run the installation again.
'''
Preparing... ######################################## ### [100%]
1: jdk ####################################### #### [100%]
Unpacking JAR files...
Rt. jar...
Jsse. jar...
Charsets. jar...
Tools. jar...
Localedata. jar...
Jfxrt. jar...
'''
Configure environment variables
Edit environment variables and configure path and classpath. Vi/etc/profile and add the following configuration:
'''
Export JAVA_HOME =/usr/java/jdk1.8.0/
Export CLASSPATH =.: $ JAVA_HOME/jre/lib/rt. jar: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
'''
After saving and exiting, run 'source/etc/profile 'to make the change take effect.
Check whether the installation is correct. execute 'Java-version' and 'javac-version' in the shell. if the shell displays the following information, the installation is successful:
'''
[Root @ localhost Downloads] # java-version
Java version "1.8.0"
Java (TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot (TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
[Root @ localhost Downloads] # javac-version
Javac 1.8.0
'''