Java 有没有不用手动下载新版本就可以更新JDK的方法?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1829986/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 23:03:44  来源:igfitidea点击:

Is there a way to update the JDK without manually downloading the new version?

javaauto-update

提问by Ben S

I just got an Java update notification that Update 17 is out, so I ran the update and found that only my public JRE was updated. I still only have Update 16 of the JDK.

我刚刚收到更新 17 已发布的 Java 更新通知,因此我运行了更新并发现只有我的公共 JRE 被更新。我仍然只有 JDK 的 Update 16。

Is there a way to have the latest JDK automatically when it's available?

有没有办法在最新的 JDK 可用时自动获得它?

Of course, the update shouldn't get rid of old versions. That should be done manually since Eclipse is still using the old version. Once I've updated my settings I would delete the old JDK manually.

当然,更新不应该摆脱旧版本。这应该手动完成,因为 Eclipse 仍在使用旧版本。更新设置后,我将手动删除旧的 JDK。

采纳答案by bmargulies

Not on Windows. If you are getting your JDK via a linux distro with an auto-updater, you could depend on that. Somehow I doubt that is what you have in mind. I do not believe that there is any Sun-supplied auto-download for the JDK.

不在 Windows 上。如果您通过带有自动更新程序的 linux 发行版获取 JDK,则可以依赖它。不知怎的,我怀疑这就是你的想法。我不相信有任何 Sun 提供的 JDK 自动下载。

回答by Thorbj?rn Ravn Andersen

Under OS X this is part of the operating system and is automatically updated. For Windows you must do it yourself.

在 OS X 下,这是操作系统的一部分,会自动更新。对于 Windows,您必须自己完成。

回答by Fuhrmanator

Secunia PSI(a free version that runs on a single PC) will update it automatically. Read a review of it here. If you're running both Java 6 and Java 7 JREs (like me), there can be glitches and you still have to update manually sometimes.

Secunia PSI(在单台 PC 上运行的免费版本)将自动更新它。在这里阅读它的评论。如果您同时运行 Java 6 和 Java 7 JRE(像我一样),可能会出现故障,有时您仍然需要手动更新。

回答by bcdewberry

Niniteis a great website that lets you download the latest version of multiple applications/packages. If you save the installer, it will always pull the most recent version and download/install it without prompts. Reference: https://ninite.com/help/home/update.html

Ninite是一个很棒的网站,可让您下载多个应用程序/软件包的最新版本。如果您保存安装程序,它将始终拉取最新版本并在没有提示的情况下下载/安装它。参考:https: //ninite.com/help/home/update.html

I did this myself just now, only caveat is that I had to delete the older jdk folder in "C:\Program Files\Java" in order for the "java -version" command to recognize the change.

我刚刚自己做了这个,唯一需要注意的是,我必须删除“C:\Program Files\Java”中较旧的 jdk 文件夹,以便“java -version”命令识别更改。

回答by francoisr

On MacOS, javacan now be installed through the Homebrew package manager. After installing Homebrew, you can simply run:

在 MacOS 上,java现在可以通过 Homebrew 包管理器安装。安装 Homebrew 后,您可以简单地运行:

brew cask install java

brew cask install java

to install the latest java version. It can then be kept up using

安装最新的java版本。然后可以继续使用

brew cask reinstall java

brew cask reinstall java