为什么Apache项目对Java版本敏感?

huangapple go评论64阅读模式
英文:

Why are Apache Projects sensitive to Java Versions?

问题

为什么我不能保留最新版本的Java,而必须降级到Java 8,几乎所有的Apache项目都是如此?
Java不具备向后兼容性吗?
在旧版本JDK上编译生成的字节码应该能够在较新版本JDK的JVM上正常运行。
为什么我必须经历从源代码构建的痛苦呢?
我原以为这是Java应该克服的问题之一!

英文:

Why is it that I can't keep the latest version of Java, that I have to downgrade to Java 8 for almost all Apache Projects?
Is Java not backward compatible?
A program compiled to ByteCode on a older JDK should be run perfectly well on the JVM of a newer JDK.
Why is it that I have to go through the pains of building from source?
I thought this was one of the things that Java was supposed to overcome!

答案1

得分: 1

这个问题不仅限于Apache项目。在更新的Java版本中,问题不再是“理解旧代码”,而更多地涉及“我是否被允许以旧的方式使用这些特性”(模块化)。

在某些情况下,旧代码还使用了最新JDK中不再存在的功能(例如移除了JEE模块)。我建议阅读Oracle迁移指南以获取更多信息。

对于(较大的)项目来说,升级到Java 8之上的迁移是需要进行规划和组织的,而且需要很多时间。

英文:

This problem is not exclusive to Apache projects. With the newer Java Versions it's not so much about 'understanding the older code' but more about 'am I allowed to use these features the old way' (modularization).

In some cases the older code also uses features that are just not part of the latest JDK any more (e.g. removal of JEE Modules). I'd recommend to read Oracles Migation Guide for more on this topic.

For (bigger) projects the Migration to >Java8 is something that needs to be planned and organized and takes a lot of time.

huangapple
  • 本文由 发表于 2020年8月28日 14:09:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/63628368.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定