'How to automate the download of latest jdk file using shell scripting from oracle

How to automate the download of latest jdk.exe file using shell scripting from oracle and convert to .zip file ?



Solution 1:[1]

https://www.oracle.com/java/technologies/downloads/#jdk18-windows

You can directly download the .zip format from the oracle website.

There is no need to convert it from .exe to .zip.

Also, it would be better if you could clarify what shell you need. Considering that youre looking for .exe, im guessing powershell? But who knows...

Im guessing you would just need to copy the download link and have the script grab it from there. For example with bash it would be like below:

#!/bin/bash
curl https://download.oracle.com/java/18/latest/jdk-18_windows-x64_bin.zip -o latest_jdk.zip

download zip file image

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 imlowbatt