4.10.0 UnsupportedClassVersionError: org/antlr/v4/Tool has been compiled by a more recent version of the Java Runtime

810 views
Skip to first unread message

Thomas Leplus

unread,
Apr 14, 2022, 1:56:53 PM4/14/22
to antlr-discussion
Hi,

The build of my project[1] started to fail after I upgraded to 4.10. I am building using JDK8 to ensure Java 8 compatibility. My understanding from the Antlr release notes[2] is that Java 8 runtime is intended to be supported: "Java runtime target [...] and the associated runtime tests use Java 8".

However my build fails with the following exception:
java.lang.UnsupportedClassVersionError: org/antlr/v4/Tool has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

The release's Antlr pom.xml[3] does say:
<maven.compiler.target>11</maven.compiler.target>

So I just want to confirm if that's intentional and the doc is out of date (or I am misunderstanding it)?

Cheers,

Tom

Terence Parr

unread,
Apr 14, 2022, 4:07:47 PM4/14/22
to antlr-discussion
Sorry about that. Yeah, i though setting version to 1.8 was enough. nope. we need to set release version. I guess I can try to release a new jar via maven then update jars on website?
Ter

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/antlr-discussion/636bd1f9-8c93-4ab8-8e17-f0cc57337a5dn%40googlegroups.com.


--
Dictation in use. Please excuse homophones, malapropisms, and nonsense.

Daniel Halperin

unread,
Apr 15, 2022, 1:57:26 PM4/15/22
to antlr-discussion
Jumping on this thread, os it time for a new major version / some breaking changes?

Java 8 is basically EOL -- active support ended in March and it's now security updates only. Moving to newer versions may admit cleaner code, better optimizations, etc. The transition period might also be a time to be a little less risk-averse with library improvements.

Dan

Terence Parr

unread,
Apr 15, 2022, 2:06:03 PM4/15/22
to antlr-di...@googlegroups.com
I think it's worthwhile discussion, but we keep coming back to the fact that backward compatibility can help since there are lots and lots of people using older versions of java.  In fact there's also a lot of libraries that have packaged antlr that can't easily be upgraded etc…

Anyway, I just deployed 4.10.1-SNAPSHOT. Can someone using maven verify that it's now 1.8 for the runtime not 11?

Thanks!
Terence

Dictation in use. Please excuse homophones, malapropisms, and nonsense.


Reply all
Reply to author
Forward
0 new messages