Centos Command mode download JDK1.7

Source: Internet
Author: User
Tags ssl connection

First to official find:

Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Download jdk1.7 using the wget command

# When you need to download the JDK, it is not possible to use the wget command directly. The solution is as follows:

# just need to add a special cookie on wget to get it done, download the full command of the latest version of Jdk-7u21:

wget--no-cookie--header "cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2f" http://download.oracle.com/otn-pub/java/ Jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz? Authparam=1461458726_3c8fc7f6eaa41b7c74384bfbbc4fff24

# and if unable to establish SSL connection is present, add –no-check-certificate after wget, command as follows:

wget--no-cookie--no-check-certificate--header "cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2f"/HTTP/ Download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz? Authparam=1461458726_3c8fc7f6eaa41b7c74384bfbbc4fff24

Setting the JDK environment variable here is the global setting method, which is to modify Etc/profile, which is a common environment variable for all users.

sudo gedit/etc/profile

After opening, add at the end

Export java_home=/usr/local/java/jdk1.7.0_45

Export JRE_HOME=/USR/LOCAL/JAVA/JDK1.7.0_45/JRE

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib: $CLASSPATH

Export path= $JAVA _home/bin: $PATH

and then save

Source/etc/profile

Centos Command mode download JDK1.7

Related Article

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.