Gradle IntelliJ Idea JavaFX Runtime Error - java

I wanted to use JavaFX to start doing an interface to my app but I get error:
java.lang.UnsupportedClassVersionError: org/openjfx/gradle/JavaFXPlugin 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
> org/openjfx/gradle/JavaFXPlugin 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
Can someone please explain me how to fix it for IntelliJ Idea?
Thank you!

It says that your current version of Java only recognises class file version up to 52.0. This means you have Java 1.8 (version 8) installed on your system.
Simply install Java version 11 to remove the error. Or if you already have Java 11 installed, then check your project's JDK path and make sure that you've configured JDK 11.
Check this out for step by step solution on Eclipse IDE

Related

Error when I run flutter doctor --android-licenses

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider 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
I tried also JDK 11 but it doesn't works.
How do I fix?
This error is telling us that our class was compiled at a higher version of Java than the version with which we tried to run it. More specifically, in this case we compiled our class with Java 11 and tried to run it with Java 8.
we have two ways we can resolve this error: compile our code for an earlier version of Java, or run our code on a newer Java version.
I think this website might help you https://www.baeldung.com/java-lang-unsupportedclassversion

Unsupported class version error on Java Eclipse editor

my eclipse editor had an error in the last 2 days, but never before. It says
java.lang.UnsupportedClassVersionError: com/pluginswithalfa/java/takeinandout has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 53.0
I use MacOS and i am a newbie could someone please help me

Launch4j-FakeMain compiled by more recent version Java Runtime(class file version 55 0)this Java Runtime only recognizes class file version up to 52 0

This is my first application that i try to execute exe.
I'm using launch4j to do this. After executing and trying to run, I get this error:
Blockquote
Launch4j - Exception in thread "main" java.lang.UnsupportedClassVersionError: FakeMain 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
I searched something about versions of java, so I checked my versions of java and they are the same.
That's my versions of java:
My versions of java in cmd
Maybe I did something wrong there?
Screen of Launch4j
I don't know what I can do. I spend all this day about fix this and nothing.
Error after try to run exe file
You have compiled the code with Java 11 as target. But your PC want's to execute the Java Code with Version 8, which is not possible.
Make sure you have installed the correct Versions and also make sure that the executable uses Java 11.
Here you can find the Java Versions mapped to the Runtime Versions: Java Version Numbers
The Article gives you also some information about how to compile and execute for the correct versions.

JavaFX cass file wrong version

I have problem with JavaFX.
My jdk version is OpenJDK version "1.8.0_222" and javac 1.8.0_222. When i start JavaFX app i have this error .
Error:(3, 26) java: cannot access javafx.application.Application
bad class file: /usr/share/openjfx/lib/javafx.graphics.jar!/javafx/application/Application.class
class file has wrong version 54.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
you are using a jdk version not compatible with your openjfx version. You can update the openjdk version at least to version 10 or check you are using openjfx version 8 at most.

Unsupported major.minor 52.0 exception in Java

Given such an exception:
java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0
And I know this is because that the JDK and JRE are not compatible. However, when I type in:
which java
The output is:
/usr/java/jdk1.6.0_24/bin/java
And when typing in:
which javac
The output is:
/usr/java/jdk1.6.0_24/bin/javac
It is the compatible in version. So what's the problem?
The problem is typically caused by this sequence:
Code is compiled with new JDK, and "target" set to current version of Java.
Attempt to run the code with an older JDK or JRE.
In this case, minor version 52 means that something has been compiled with a Java 8 JDK, and with Java 8 as the target platform, and that you are attempting to run it on an older JRE / JDK.
You could also have gotten a JAR file from somewhere else that was compiled for Java 8.
To solve your problem, you need to figure out:
which class file or files have the version number problem (the exception message should tell you the first one ...),
where the class file came from (from a JAR file? from the file system?), and then
how come it was compiled with Java 8 though you thought you were compiling with Java 6.
It is an indisputable fact that the class that won't load was compiled using Java 8 (or later) compiler. You need to figure out why, and then either recompile it with the older JDK, or run it with Java 8.
it says version 52.0 so you should install java 8.
Check if tools.jar used during compilation complies with the JRE set. If you are on eclipse, verify the versions as:
Goto Window->Preferences
Check Ant Runtime by selecting Runtime under Ant in the left pane. Check the Global Entries under classpath tab. You can see the version in folder path.
On the left pane check installed JREs under Java. Check the version.

Categories