wget下载oracle jdk

oracle的jdk必须要同意协议才能下载,否则自动跳转。

通过在wget加入cookie即可解决


wget -c --no-cookies --header "Cookie: gpw_e24=encodeurl的浏览页" "文件地址" --output-document="本地文件名"


以下载jdk1.6为例


wget -c --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk6u35-downloads-1836443.html" "http://download.oracle.com/otn-pub/java/jdk/6u35-b10/jdk-6u35-linux-i586-rpm.bin" --output-document="jdk-6u35-linux-i586-rpm.bin"
其中浏览页是:


http://www.oracle.com/technetwork/java/javase/downloads/jdk6u35-downloads-1836443.html

文件地址是:


http://download.oracle.com/otn-pub/java/jdk/6u35-b10/jdk-6u35-linux-i586-rpm.bin



参考:

https://forums.oracle.com/forums/thread.jspa?threadID=2365607


你可能感兴趣的:(jdk,wget)