SarfarazKhan
SarfarazKhan

Reputation: 69

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.

Upvotes: 3

Views: 3524

Answers (2)

Mataksik
Mataksik

Reputation: 11

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"

Upvotes: 1

4c74356b41
4c74356b41

Reputation: 72171

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)

Upvotes: 3

Related Questions