The most common reason you’d want to do this is if you have a remote server which you can only access via SSH. Downloading jdk first to your computer then uploading it is an option but often it’s slow. Here’s how you can download it directly from your SSH shell:
- Using Google Chrome browser, go to Oracle JDK download page, pick the jdk package you want to download
- Press F12 to open Chrome’s developer tools. Go to Network tab.
- Accept the user agreement on Oracle’s website, and click the package link
- On developer tools window, find the first entry that has your package name. Right click and select Copy as cURL
- Now the curl command required to download the package is in your clipboard. You can paste this to your remote server’s SSH session and use it to download the package directly