gpt4 book ai didi

java - Java 如何检查是否过时

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:21:38 25 4
gpt4 key购买 nike

我有一个没有连接到 Internet 的 linux box。我已经在上面安装了 Firefox 24.0jre1.7.0_40(还有 1.7.0_17)当我使用本地安装在盒子上的 Web 应用程序启动 FF 时,我收到一个警告弹出窗口

Java Update Needed; YourJava version is out of date

我不明白 Java 是如何知道“过时”的???什么比较什么?我假设检查 oracle.com 上的可用版本,如果系统上安装的当前版本太旧,则删除此警告。

或者启动的应用程序本身带有一些关于 Java 版本的信息,哪些是可用的,哪些是在编译时使用的??

最佳答案

1.7.0u10 release notes中有解释.

The JRE relies on periodic checks with an Oracle Server to determine if it (the JRE)is still considered up-to-date with all the available security fixes (above the security baseline). In the past, if the JRE was unable to contact the Oracle Server, it continued to behave as though it is still the most recent version with regard to security, for an indefinite period.

To avoid this problem, a secondary mechanism, that does not rely on external communication, has been added to the JDK 7u10. From this release onwards, all JREs will contain a hard-coded expiration date. The expiration date is calculated to end after the scheduled release of the next Critical Patch Update.

在线检查从 https://javadl-esd-secure.oracle.com/update/baseline.version 获取数据,我相信。

JRE 中硬编码的到期日期和版本存储在 deploy.jar 中的 BuiltInProperties.class

对于 1.7.0u45,我们有

public static final boolean JRE_BASELINE_CHECKS_ENABLED = true;
public static final String JRE_EXPIRATION_DATE = "02/14/2014";
public static final String BASELINE_VERSION_131 = "1.3.1_21";
public static final String BASELINE_VERSION_142 = "1.4.2_43";
public static final String BASELINE_VERSION_150 = "1.5.0_55";
public static final String BASELINE_VERSION_160 = "1.6.0_65";
public static final String BASELINE_VERSION_170 = "1.7.0_45";
public static final String BASELINE_VERSION_180 = "1.8.0";
public static final String CURRENT_VERSION = "1.7.0_45";
public static final String CURRENT_NODOT_VERSION = "170";
public static final String DEPLOY_VERSION = "10.45.2.18";
public static final String DEPLOY_NOBUILD_VERSION = "10.45.2";
public static final String DEPLOY_NODOT_VERSION = "10452";
public static final String JAVAWS_NAME = "javaws-10.45.2.18";
public static final String JAVAWS_VERSION = "10.45.2.18";

关于java - Java 如何检查是否过时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20524800/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com