Jdk 1.8 installation tutorial in centos7, centos7jdk

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.