Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

From command line download latest Java SE Runtime Environment 8 on Windows

On a Windows server, I am looking for a robust way to download latest Java SE Runtimes from command-line .

My requirement is to check if java is installed on the system. If java is not found, our MSI installer (created with WIX) need to connect oracle java download page and silently download java installer in the background and invoke the installer silently. Download option can be in VB script/PowerShell/batch/Java

Installing java silently is easy with jre-8u121-windows-x64.exe /soption.

I could find couple of solutions to download jre on *nix with curl/wget from this post

However, couldn't find any robust solution on Windows.

Please let me know is there a fool proof way to download JRE installer on Windows from command line.

like image 644
SarfarazKhan Avatar asked Apr 29 '26 12:04

SarfarazKhan


2 Answers

I'd go with chocolatey, its simple, easy and handles all the pain for you (like keeping up with the new versions or when the link changes, etc)

like image 136
4c74356b41 Avatar answered May 02 '26 00:05

4c74356b41


cmd.exe /c "MD C:\Install-temp&bitsadmin /transfer Download /download /priority high https://javadl.oracle.com/webapps/download/AutoDL?BundleId=236886_42970487e3af4f5aa5bca3f542482c60 c:\Install-temp\Java.exe&start /wait c:\Install-temp\Java.exe /s & RD c:\Install-temp /S /Q"

like image 43
Mataksik Avatar answered May 02 '26 01:05

Mataksik