Issue
I've just started installing ANTLR on my Windows PC and have run into a problem.
I installed Java as part of this (file JavaSetup8u341.exe
, the latest, it would appear), but when I run the first test of the installation with java org.antlr.v4.Tool
, I get the following error:
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
The Java control panel tells me that I have the latest version (platform version 1.8; the instructions suggest anything above 1.7).
I'm at a loss as to what to do next.
Solution
class suprt bit 55 mean Java SE 11, but you have 52 mean Java SE 8, you need upgrade you JRE to at least 11.
on windows, you can download from https://docs.microsoft.com/en-us/java/openjdk/download
about class suprt bit, see https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html
Answered By - arli weng
Answer Checked By - Robin (JavaFixing Admin)