How to install JAVA 7 (JDK 7u75) in Centos/rhel 7/6/5 Fedora

Source: Internet
Author: User






Download the JDK first




For bit:-

# cd/opt/# wget--no-cookies--no-check-certificate--header "COOKIE:GPW_E24=HTTP%3A%2F%2FWWW.ORACLE.COM%2F; Oraclelicense=accept-securebackup-cookie "" Http://download.oracle.com/otn-pub/java/jdk/7u75-b13/jdk-7u75-linux-x64.tar.gz "



For bit:-

# cd/opt/# wget--no-cookies--no-check-certificate--header "COOKIE:GPW_E24=HTTP%3A%2F%2FWWW.ORACLE.COM%2F; Oraclelicense=accept-securebackup-cookie "" http://download.oracle.com/otn-pub/java/jdk/7u75-b13/ Jdk-7u75-linux-i586.tar.gz "


Unzip and move to/opt


# tar Xzf jdk-7u75-linux-x64.tar.gz

# MV Jdk1.7.0_75/opt


Set as Default virtual machine


# cd/opt/jdk1.7.0_75/# Alternatives--install/usr/bin/java java/opt/jdk1.7.0_75/bin/java Alternatives--config java



Select 4 when the following options appear

There is 4 programs which provide ' Java '.  Selection    Command-----------------------------------------------*  1           /usr/lib/jvm/jre-1.6.0-openjdk /bin/java + 2           /opt/jdk1.7.0_60/bin/java   3           /opt/jdk1.7.0_72/bin/java   4           /opt/jdk1.7.0_75/bin/ Javaenter to keep the current selection[+], or type selection number:4 [Press Enter]



Now you can try the Java version, the output is as follows


# Java-versionjava Version "1.7.0_75" Java (tm) SE Runtime Environment (build 1.7.0_75-b13) Java HotSpot (tm) 64-bit Server V M (build 24.75-b04, Mixed mode)


Set Environment variables


cat >>/etc/profile.d/java7. sh << eofexport java_home=/opt/jdk1. 7 . 0_75export jre_home=/opt/jdk1. 7. 0_75/jreexport PATH=\ $PATH:/opt/jdk1. 7. 0_75/bin:/opt/jdk1. 7. 0_75/jre/bineof




Re-open the terminal env|grep HOME to see the results






How to install JAVA 7 (JDK 7u75) in Centos/rhel 7/6/5 Fedora




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.