activemq icon indicating copy to clipboard operation
activemq copied to clipboard

Fix antrun for openwire-generate and allow (require) JDK8 for now

Open jbonofre opened this issue 10 months ago • 4 comments

jbonofre avatar Mar 30 '25 17:03 jbonofre

@kenliao94 as discussed on the mailing list.

jbonofre avatar Mar 30 '25 17:03 jbonofre

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.1.0:run (default-cli) on project activemq-client: An Ant BuildException has occured: java.lang.UnsupportedClassVersionError: org/apache/activemq/openwire/tool/JavaGeneratorTask has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] around Ant part ...<taskdef classname="org.apache.activemq.openwire.tool.JavaGeneratorTask" name="generate" classpathref="maven.compile.classpath" />... @ 5:135 in /Users/qrl/amzn/personal_workspace/activemq/activemq-client/target/antrun/build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.1.0:run (default-cli) on project activemq-client: An Ant BuildException has occured: java.lang.UnsupportedClassVersionError: org/apache/activemq/openwire/tool/JavaGeneratorTask has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
around Ant part ...<taskdef classname="org.apache.activemq.openwire.tool.JavaGeneratorTask" name="generate" classpathref="maven.compile.classpath" />... @ 5:135 in /Users/qrl/amzn/personal_workspace/activemq/activemq-client/target/antrun/build-main.xml
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)

Hey @jbonofre it might be due to my local environment but since I configured Java 17 to work on main branch. I seem to can't get rid of this error. I tried to use mvn cli and configured the java_home to point to java 8 and it showed me this error. Do I need to be 5.16 branch and configure java 8 to generate?

kenliao94 avatar Apr 01 '25 01:04 kenliao94

As you can see in my change, jdk8 is still required here. I will update to jdk17+ in a separate PR.

jbonofre avatar Apr 01 '25 05:04 jbonofre

As mentioned on the dev list and on the Jira Issue, there is a new project for future OpenWire versions that is being modernized. It's fine to fix this to require JDK 8, but I don't think it's necessary or make sense to bother with fixing the current version for JDK 17.

I think we should probably just remove the old generator entirely from the 6.x build as it doesn't work on newer JDKs and we plan to migrate to the new project for v13 and future updates.

cshannon avatar Apr 07 '25 19:04 cshannon