英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论