简体   繁体   English

从命令行下载 Windows 上最新的 Java SE Runtime Environment 8

[英]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 .在 Windows 服务器上,我正在寻找一种从命令行下载最新 Java SE 运行时的可靠方法。

My requirement is to check if java is installed on the system.我的要求是检查系统上是否安装了java。 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.如果找不到java,我们的MSI安装程序(用WIX创建)需要连接oracle java下载页面,在后台静默下载java安装程序,静默调用安装程序。 Download option can be in VB script/PowerShell/batch/Java下载选项可以在VB脚本/PowerShell/batch/Java

Installing java silently is easy with jre-8u121-windows-x64.exe /s option.使用jre-8u121-windows-x64.exe /s选项可以轻松静默安装 java。

I could find couple of solutions to download jre on *nix with curl/wget from this post我可以从这篇文章中找到几个使用 curl/wget 在 *nix 上下载 jre 的解决方案

However, couldn't find any robust solution on Windows.但是,在 Windows 上找不到任何强大的解决方案。

Please let me know is there a fool proof way to download JRE installer on Windows from command line.请让我知道是否有一种万无一失的方法可以从命令行下载 Windows 上的 JRE 安装程序。

我会选择Chocolatey ,它简单、容易并且可以为你处理所有的痛苦(比如跟上新版本或链接发生变化时等)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM