Fedora 21 Configuration JDK environment Replacement OPENJDK

Source: Internet
Author: User

1. View Fedora's existing Java environment version

OPENJDK version "1.8.0_25" OPENJDK Runtime Environment (build 1.8.0_25-b18) openjdk 64-bit Server VM (build 25.25-b02, mixed Mode

2. Download Sun's latest jdk RPM version

A.: http://www.oracle.com/technetwork/java/javase/downloads/index.html

The latest version I downloaded here is jdk-8u25-linux-x64.rpm [Fedora 64-bit system, please select the version for your system]

B. Installation:

Rpm-iv jdk-8u25-linux-x64.rpm

  Error: XXX appears xxx is not in the sudoers file, this matter will be reported

Solve:

Visudo

#visudo can modify the edit/etc/sudoers to join with the following own user xxx sudo to perform the appropriate permissions

XXX all= (All) all

Re-RPM-IV jdk-8u25-linux-x64.rpm successfully installed!

3. Configure Java Environment variables

vim  /etc/profile # 添加以下内容   JAVA_HOME= /usr/local/java   PATH=$JAVA_HOME /bin :$PATH   CLASSPATH=.:$JAVA_HOME /lib/dt .jar:$JAVA_HOME /lib/tools .jar   export JAVA_HOME   export PATH   export CLASSPATH # 退出编辑模式,回到命令行,运行 source /etc/profile#再次运行java-version View information Display java-version# show Java version "1.8.0_25"
Java (TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot (TM) 64-bit Server VM (build 25.25-b02, Mixed mode) #还没完, don't know why every time I open a new terminal and then go back and then configure the default javasudo/usr/s directly Bin/alternatives--config Java
[sudo] password for QKL:

There are a total of 2 programs that provide "Java".

Options command
-----------------------------------------------
* 1/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.25-4.b18.fc21.x86_64/jre/bin/java
+ 2/usr/java/jdk1.8.0_25/bin/java

Press Enter to leave the current option [+], or type the option number:
#根据我这边的显示新安装的java JDK above Enter number 2 OK

  

Fedora 21 Configuration JDK environment Replacement OPENJDK

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.