Oracle has recently disabled direct download of java from their servers. So to download java , users have to visit their site via web browser and have to accept their license and terms , then users will get the download link.
But if you are working of linux servers in which you can’t access the web browser , then you should use wget command on the console.
Use Below command to download java from linux console / terminal.
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2F www.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-x64.tar.gz"
- Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F :- It is a single cookie for all that is needed to bypass license and terms
- –no-cookies : – Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the “Set-Cookie” header, and the client responds with the same cookie upon further requests.
- –no-check-certificate : – Don’t check the server certificate against the available certificate authorities. Also don’t require the URL host name to match the common name presented by the certificate.