开发者

activemq java version

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 us开发者_Go百科ing 1.5, and if it is executed in 1.4, should we not get an 'Unsupported major.minor version' exception?


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.


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜