Install the official JDK under Fedora 20 to replace OpenJDK and configure environment variables.

Source: Internet
Author: User

Fedora 20 comes with OpenJDK, So if you install the official JDK, you must first Delete OpenJDK as follows:

1: run the rpm-qa | grep jdk command to check the current jdk status.

2: yum-y remove java java-1.7.0-openjdk * uninstall openjdk, which may uninstall some additional software due to dependency.

3: Download the official JDK from oracle.gz.

4: Decompress the jdk installation package tar-zxvf jdk-7u51-linux-x64.tar.gz to copy to your own software folder, my software is generally put under opt, so mv jdk1.7.0 _ 51 // opt/

5: configure the environment variable vi/etc/profile and enter the following content in the last row.

Export JAVA_HOME =/opt/jdk1.7.0 _ 51

Export CLASSPATH = $ CLASSPATH: $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib

Export PATH = $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin: $ PATH: $ HOME/bin

6: make the environment variable take effect source/etc/profile

7. Enter java or java-version.

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.