Jdk 1.8 installation tutorial in centos7, centos7jdk
1. Download the installation package jdk-8u11-linux-x64.tar.gz of jdk1.8 for linux
2. Uninstall the openjdk originally provided by centos and run the command: rpm-qa | grep java.
Then, run the command rpm-e -- nodeps and the jdk name that comes with the system to delete the jdk that comes with the system,
Example: rpm-e -- nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
Rpm-e -- nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
Rpm-e -- nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
Rpm-e -- nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64
3. Create a java directory in the/home directory, mkdir java
Upload the installation package to the java directory and decompress the tar -zxvfjdk-8u11-linux-x64.tar.gz file.
4. Configure the environment vi/etc/profile and add
Export JAVA_HOME =/home/java/jdk1.8.0 _ 11 export CLASSPATH =.: $ JAVA_HOME/jre/lib/rt. jar: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jarexport PATH = $ PATH: $ JAVA_HOME/bin
5. Run the effective configuration: there is a space between./etc/profile and/, and check the java-version
Now OK