OPENJDK and Oracle JDK coexistence under Fedora Server 21

Source: Internet
Author: User

Reference article: Blog Park-three-dimensional ants

Linux Commune

1, first need to download the corresponding Platform Jdk:oracle official website

2. Install the JDK using the Yum or RPM command:

Yum install ./jdk-8u40-linux-x64.rpm

3. After configuring the environment variable Vi/etc/profile, enter the following at the penultimate line:

Export JAVA_HOME=/USR/JAVA/JDK1. 8 . 0_40export PATH= $JAVA _home/bin: $PATHexport CLASSPATH=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/ Tools.jar

If you need to use it under the current user, it is recommended that the above environment variable be appended to the ~/.bash_profile file.

4. Make the environment variable effective source/etc/profile

5. Install the installed Oracle JDK into the system:

Update-alternatives--install /usr/bin/java java/usr/java/jdk1. 8  - update-alternatives-install /usr/bin/javac javac/usr/java/jdk1. 8  -

6. Set the Oracle JDK as the default:

Update-alternatives--config Java

At this point if there are multiple JDK (such as OPENJDK and Oracle JDK), will come out a list, the current default will be in front of the list has a "*" number, then we have to choose the Oracle JDK we just installed the Java serial number, enter this serial number, the return on the line.

OPENJDK and Oracle JDK coexistence under Fedora Server 21

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.