activemq java版本

发布于 2024-10-07 21:14:28 字数 171 浏览 0 评论 0原文

在 ActiveMQ 文档中,提到:

注意:ActiveMQ 可以在 Java 1.4.x 系统上运行,但是,编译/构建 ActiveMQ 需要 Java 1.5..

这怎么可能?如果它是使用 1.5 编译的,并且如果它是在 1.4 中执行的,我们是否应该得到“不支持的主要版本.次要版本”异常?

In the ActiveMQ docs, it is mentioned :

NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ..

How is this possible? If it is compiled using 1.5, and if it is executed in 1.4, should we not get an 'Unsupported major.minor version' exception?

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

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

发布评论

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

评论(2

怪我太投入 2024-10-14 21:14:28

难道你不认为这不是ActiveMQ本身造成的,而是两个Java版本(1.4和1.5)之间的差异以及Java1.5源代码的编译完成方式造成的。所有 Java5 的新颖之处都被转换为 Java 1.4 字节码(例如,阅读用于实现 Java1.5 泛型的类型擦除技术)。

我对此不是 100% 确定;当我读到你的问题时,这是我的第一个想法。

Don't you think that it is not caused by ActiveMQ itself, but the differences between two Java versions (1.4 and 1.5) and the way in which compilation of Java1.5 source code was accomplished. All Java5 novelties are translated to Java 1.4 bytecode (e.g. read about type erasure technique that is used to achieve Java1.5 generics).

I am not 100% sure about it; it was my first thought when I read your question.

野稚 2024-10-14 21:14:28

有一些技术可以将 .class 文件(Java 字节码)转换为另一个早期的 JVM。例如,Ist ​​确实将新的 for 循环 (for (X x : xs)) 转换为带有迭代器的循环。如果此转换过程未将新的 JDK 类添加到目标 JDK 兼容版本中,则对新 JDK 类的引用可能不起作用。

我已经将其视为 Maven 构建器。使用它时,我能够使用 Java 1.5 为旧的 WebSphere Server(1.4)编写 portlet。 Maven 为我完成了构建 war 文件的所有工作。输出是 portlet-1.0.0.java4.war 和 portlet-1.0.0.java5.war。

请参阅Retrotranslator:http://retrotranslator.sourceforge.net/

There are techniques to convert the .class-Files, which are Java Bytecode, to another, earlier JVM. Ist does, for example, convert the new for-Loop (for (X x : xs)) to that one with an iterator. References to new JDK-Classes maybe won't work, if this conversion process does not add them in a target-JDK compatible version.

I've seen this as a maven builder. When using this I was able to program portlets in Java 1.5 for an old WebSphere Server which was 1.4. Maven did everything for me on building the war file. The output was a portlet-1.0.0.java4.war and a portlet-1.0.0.java5.war.

See Retrotranslator: http://retrotranslator.sourceforge.net/

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