Installing Java JDK on Linux

Source: Internet
Author: User

Yum mode

1. View each version in Yum

Yum-y List java*

2. Select a version to install (e.g. 1.7)

Yum-y Install java-1.7.0-openjdk*

3. You can view the version information after the installation is complete.

Java-version//If the version information is printed stating that the installation was successful, yum Setup automatically sets environment variables without manual setup

RPM mode

1, go to http://www.oracle.com/technetwork/java/javase/downloads/index.html Download the Java JDK rpm package, such as (JDK-7U79-LINUX-X64.RPM)

2, Rpm-ivh jdk-7u79-linux-x64.rpm

3. Setting Environment variables

Using the Vim/etc/profile configuration file, add the following Java environment configuration at the end of the file

Java_home=/usr/java/jdk1.7.0_79jre_home=/usr/java/jdk1.7.0_79/jreclass_path=.: $JAVA _home/lib/dt.jar: $JAVA _home /lib/tools.jar: $JRE _home/libpath= $PATH: $JAVA _home/bin: $JRE _home/binexport java_home jre_home class_path PATH

4, Source/etc/profile

  

Installing Java JDK on Linux

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.