Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Started has error #3744

Closed
Nicksxs opened this issue Jun 12, 2022 · 13 comments
Closed

Getting Started has error #3744

Nicksxs opened this issue Jun 12, 2022 · 13 comments

Comments

@Nicksxs
Copy link
Contributor

Nicksxs commented Jun 12, 2022

i just run the test command
java org.antlr.v4.Tool
my java version is "1.8.0_291"
and the error is
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" 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
this mean it does not support java earlier than jdk 11,
but your Getting Started with ANTLR v4 said just java version 1.7 or higher

@ericvergnaud
Copy link
Contributor

Yes the doc needs an update.

@rossy62
Copy link

rossy62 commented Jun 13, 2022

Just ran into this. New laptop and JAVA/ANTLR were not installed. My guess is this is related to Oracle now charging for latest Java (since 2019). But Thats just a wild guess.
Trying to figure out the quickest hack to get my ANTLR4 dependent builds to fly.
Maybe an older JRE might be fastest. Although I have the sources I figure I could try to rebuild them in theory.

@Nicksxs
Copy link
Contributor Author

Nicksxs commented Jun 14, 2022

may i submit a pull request

@parrt
Copy link
Member

parrt commented Jun 25, 2022

Fixed by #3748

@parrt parrt added this to the 4.10.2 milestone Jun 25, 2022
@parrt parrt closed this as completed Jun 25, 2022
@TrekkieByDay
Copy link

Wanted to let you know that I spent several hours trying to figure out how to get antlr4 to run on my Windows 10 machine. See my related SO question here.

Tomorrow's chore is to figure out the antlr4 .jar interacts with the Python module, but, at least for today, I was able to get antlr4 running. I had to uninstall my latest version of Java and revert back to 11 for it to work. Otherwise I continually got the error referenced in this issue.

@ericvergnaud
Copy link
Contributor

ericvergnaud commented Jul 22, 2022 via email

@Nicksxs
Copy link
Contributor Author

Nicksxs commented Jul 22, 2022

Java 1.8 is equals to Java 8
Java 11 is short for Java 1.11(if called like Java 1.8), which is the next LTS version after Java 1.8 or Java 8

Java version history
and here you can see java class version with java version
image

@TrekkieByDay
Copy link

TrekkieByDay commented Jul 22, 2022

I don't mean to argue... but no, I went from the current version of java (the one that is listed in green on the wikipedia page, Java SE 18) to Java SE 11 from 2018. That was the only way I could avoid the error. Perhaps there are later versions I could have used, but frankly at that point yesterday I was tired of experimenting and elated to find something that worked. I apologize if I don't quite understand the weird Java versioning scheme... but, to be clear, no. The latest version of java by the chart from Wikipedia that I'll link below, Java 18, was not compatible... at least on my machine with my environment... but Java 11 was. I went from the green highlighted one (i.e. current) to the one highlighted yellow that corresponds to September 2018. Sorry for the ambiguity.

Java version image

Edit: Now, it is completely possible that there was some weird quirk on my system... but, as I explain in my SO post, I tried uninstalling, reinstalling, triple checking path variables, and trying on two completely different machines. I don't, however, discount the possibility of being confused about something... you guys are a lot smarter on this than me. I was just trying to do my "civic duty" and let you know. 🤷

@ericvergnaud
Copy link
Contributor

ericvergnaud commented Jul 22, 2022 via email

@Nicksxs
Copy link
Contributor Author

Nicksxs commented Jul 22, 2022

@TrekkieByDay you should learning something about java version, java 1.8 also called java 8 , but which is different with java 18
java class version 52 means class generated by java 1.8 or java 8, not java 18

@TrekkieByDay
Copy link

TrekkieByDay commented Oct 11, 2022 via email

@TrekkieByDay
Copy link

TrekkieByDay commented Oct 11, 2022 via email

@parrt
Copy link
Member

parrt commented Oct 28, 2022

Thanks for letting us know @TrekkieByDay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants