我可以使用JRE 17运行使用Java 8(.192)构建的Java程序,或者所有内容(JRE,JVM,JDK)必须首先使用正确的Java 8版本?

发布于 2025-01-24 06:57:20 字数 169 浏览 0 评论 0原文

我有一个工作程序,我被告知只能使用Java版本8 Update 192正确运行。当我下载Eclipse时,建议我使用JRE 17.0.2,但我回想起我的同事说我需要Java 8更新192,否则它将无法使用。 JRE版本很重要吗?是无关紧要的吗?

也许我需要下载JRE 8.192?我不知道。任何帮助将不胜感激。

I have a program for work that I'm told will only use Java version 8 update 192 to run correctly. When I downloaded eclipse, it's suggesting that I use JRE 17.0.2 but I recalled my coworker saying I need Java 8 update 192 otherwise it won't work. Does the JRE version matter? Is it irrelevant?

Perhaps I need to download JRE 8.192? I'm not sure. Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

静谧 2025-01-31 06:57:20

java 8 仍然可用,作为第一个长期支持(LTS)版本。我建议从Java 8的最新更新开始。当前版本是更新402(如See 关于收养)。

请注意,Java 8除关键的安全补丁外没有收到公众定期更新。您可能需要考虑从任何数量的供应商(例如Azul Systems或Oracle)获得支持合同来获得支持,以获取支持,包括在本十年的其余时间内发布的其他更新。

通常,Java应用程序将在以后版本的Java上运行,而无需任何修改。 Oracle的Java团队和 openjdk 社区在保持这种兼容性方面非常优先。

但是,兼容性政策有例外。特别是:Java 9引入了 java Platform模块系统在某些应用程序中引起了某些问题。在后来的Java版本中,现在删除了一些以前捆绑的一些库。其中一些被删除的库被转移到 jakarta ee 日食基金会的项目。有些人因缺乏利益而被遗弃,例如 corba

多年来,爪哇的一些部分被标记为“最终拆除的弃用”。

如果您考虑超越Java 8,我建议您的第一步坐下来阅读Java的每个发行说明。他们写得很好。他们应提醒您可能会影响您应用程序的任何问题。

仅供参考,Java 21是最新的LTS版本。 Java 23是最新的,截至2024-11。 Java 24在春季到达。一个主要的新版本每六个月到达一次。 Java 25在2025年秋季可能是下一个LTS版本。跟踪 wikipedia上的java版本

Java 8 is still available, as the first Long-Term Support (LTS) version. I would suggest starting with the latest update of Java 8. The current release is Update 402 (as seen on Adoptium).

Be aware that Java 8 is not receiving regular updates for the public except for critical security patches. You may want to consider paying for a support contract from any number of vendors such as Azul Systems or Oracle to get support including possible additional updates releases through the rest of this decade.

Generally Java apps will run on later versions of Java without any modifications needed. The Java team at Oracle and the OpenJDK community place a very high priority on preserving that compatibility.

However, there are exceptions to the compatibility policy. In particular: Java 9 introduced the Java Platform Module System which caused some problems in some apps. And in later versions of Java some libraries that were previously bundled are now removed. Some of those removed libraries were transferred to the Jakarta EE project at the Eclipse Foundation. Some were abandoned for lack of interest such as CORBA.

Some few parts of Java that were for years marked as “deprecated for eventual removal” have now been removed.

If you consider moving beyond Java 8, I suggest your first step be sitting down to read through the Release Notes for every release of Java. They are quite well-written. They should alert you to any issues that may affect your app.

FYI, Java 21 is the latest LTS version. Java 23 is current, as of 2024-11. Java 24 arrives in the Spring. A major new version arrives every six months. Java 25 in Fall of 2025 is likely to be the next LTS version. Keep track of Java versions on Wikipedia.

秋叶绚丽 2025-01-31 06:57:20

我有一个工作程序,我被告知只能使用Java版本8更新192才能正确运行。

我会怀疑该声明的准确性。我会说,某人在没有证据的情况下发表声明……如果这是他们实际说的话。

也许更准确的陈述是该程序仅在该特定版本上运行 ...

无论如何,它可能会在以后版本的Java 8或Java 11中运行。确定是因为问题包装的问题是密封 /阻止Java 16中发生的内部包装的访问权

。 jre?

答:不。JDK也会工作。 (jdk distro 包括 a JRE。)但是,除非有强烈的反调查,否则您需要最新版本的Java 8、11或17。Java8 U192已过时多年。

确保应用程序将在特定版本的Java上使用的唯一方法是尝试。通常,没有捷径。

I have a program for work that I'm told will only use Java version 8 update 192 to run correctly.

I would doubt the accuracy of that statement. I would say that someone is making a statement without evidence ... if that is what they actually said.

Maybe a more accurate statement is that the program is only known to run on that particular version ...

Anyway, it will probably run on a later version of Java 8, or Java 11. Java 17 is less certain because of the issue of package sealing / blocking of access to internal packages that occurred in Java 16. (Some of the sealing / blocking started in Java 9 ... but there are easy workarounds ...)

Q: Do you need a JRE?

A: No. A JDK will work just as well. (A JDK distro includes a JRE.) But unless there are strong counter-indications, you need the latest version of Java 8, 11 or 17. Java 8 u192 is years out of date.

The only way to be sure that the application will work on a particular version of Java is to try it. In general, there are no shortcuts.

没企图 2025-01-31 06:57:20

与其他答案一样,为Java 8构建的应用程序可能会在Java 17中效果良好,有一些警告,但是如果您绝对需要在Java 8下运行的最终产品,请去获取真正的Java 8运行时并将其设置在您的IDE中。最好通过拥有该运行时的实际副本(最好是JDK)来为任何特定的Java版本构建Java应用程序。通过拥有其标准库的精确版本可以编译,您可以避免意外地指添加到或从以后的版本中添加或删除的软件包,类和方法。您可以从 https://adoptium.net/?variant/?variant = popenjdk8 。请务必询问您的同事为什么他们要提及过时的补丁版本。

此外,请记住Eclipse本身就是一个大型Java应用程序。运行它需要Java,并且越来越多的下载包括出于这个简单原因的Java运行时,甚至不包括Java开发工具的下载时间。不过,您不必针对该版本的Java编译代码 - 您甚至不想使用,因为JDK下载将包括标准库的Javadoc,以及其他有用的附加功能。

As in the other answers, an application built for Java 8 will probably work fine in Java 17, with some caveats, but if you absolutely need the final product to run under Java 8, go get a real Java 8 runtime and set it up in your IDE. Building a Java application for any specific Java version is best done by having an actual copy of that runtime present, preferably a JDK. By having an exact version of its standard library to compile against, you can avoid accidentally referring to packages, classes, and methods added to, or removed from, later versions. You can get an OpenJDK build of Java 8 from https://adoptium.net/?variant=openjdk8 . Be sure to ask your co-worker why they're mentioning an outdated patch version.

Additionally, keep in mind that Eclipse is itself a large Java application. Running it requires Java, and a growing number of downloads include a Java runtime for that simple reason, even the ones that do not include Java development tools. You don't have to compile your code against that version of Java, though--you probably don't even want to since JDK downloads will include JavaDoc for the standard library, among other useful extras.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文