由于版权原因,Linux发行版并没有包含官方版的Oracle JDK,必须自己从官网上下载安装。Oracle官网用Cookie限制下载方式,使得眼下只能用浏览器进行下载,使用其他方式可能会导致下载失败。但还是有方法可以在Linux进行下载的,
error: open of href=http://www.oracle.com/us/sitemaps/index.html </tr> <tr valign=middle> <td align=right valign=top><img src=/errors/us/assets/004894.gif height=7 vspace=3></td> <td><a href=http://www.oracle.com/technetwork/index.html>OTN Homepage</a></td> </tr> </table> <br> <div id=footer> <table width=100% border=0 cellspacing=0 cellpadding=0> <tr> <td width=50% class=legalese align=right valign=top> </td> <td width=50% class=legalese align=left valign=top > </td> </tr> <tr> <td width=50% class=legalese align=left valign=top> </td> <td width=50% class=legalese align=right valign=top><a class=legalese href=http://www.oracle.com/rss/index.html target=_top>RSS <img src=/errors/us/assets/feed-icon-14x14.png width=14 height=14 border=0></A><span class=navlink> | </span> <a class=legalese href=http://www.oracle.com/html/copyright.html target=_top>Legal Notices and Terms for Use</a><span class=navlink> | </span> <a class=legalese href=http://www.oracle.com/html/privacy.html target=_top>Privacy Statement</a><br /> </td> </tr> <tr> <td width=50% class=legalese align=right valign=top> </td> <td width=50% class=legalese align=left valign=top ></td> </tr> </table> </div> </td> <TD WIDTH=10><IMG SRC=/errors/us/assets/spacer.gif BORDER=0 ALT= WIDTH=10></TD> </tr> </table> </body> </html> failed: No such file or directory
我们需要三个参数:–no-check-certificate、–no-cookies、–header,通过man wget命令可以查到。
用于禁止检查证书
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" Unauthorized Request
rpm -ivh jdk-8u131-linux-x64.rpm 再安装即可