如何使用命令提示符更新 JAVA SDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19093170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to update JAVA SDK using command prompt
提问by Karthick
I have JAVA SDK 1.7.0.170 installed on my windows 7, I need to upgrade to 1.7.0.250. Is there a command line option?
我的 Windows 7 上安装了 JAVA SDK 1.7.0.170,我需要升级到 1.7.0.250。有命令行选项吗?
Any equivalent of PIP for python updates?
python更新的任何等效的PIP?
回答by Aaron Digulla
Not really. But what you can do is to install Java on one computer and then ZIP the folder where the files were installed. To install on all the other computers, just unzip the archive, set JAVA_HOME
and change the PATH
variable.
并不真地。但是您可以做的是在一台计算机上安装 Java,然后压缩安装文件的文件夹。要在所有其他计算机上安装,只需解压缩存档,设置JAVA_HOME
并更改PATH
变量。
If that's too much work to do manually, you can try to create a custom installer.
如果手动完成太多工作,您可以尝试创建自定义安装程序。
Note that this might violate the EULA; if you do this for a company, have legal check this.
请注意,这可能违反 EULA;如果您为公司这样做,请进行法律检查。
回答by Peter Lawrey
You can't do this from the command line for Oracle's JDK as you must accept their license agreement on their web site before you can download.
您不能从 Oracle JDK 的命令行执行此操作,因为您必须在其网站上接受他们的许可协议才能下载。
You could download and install the latest OpenJDK using wget
and run the installer. (two commands) You would need to change your environment settings which might be possible using a command line regedit, but I always use the windows configuration for this.
您可以使用wget
并运行安装程序下载并安装最新的 OpenJDK 。(两个命令)您可能需要使用命令行 regedit 更改您的环境设置,但我总是为此使用 Windows 配置。