This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 6 years ago.
I have developed a small project in eclipse which makes use of Java6. But I want to run the same project in hpux system which has java1.5. When I try to run it is throwing the error :
java.lang.UnsupportedClassVersionError:.
Then I have changed the eclipse Java compiler to java1.5 and jre to 1.5.0_12 then recompiled my project. After that I have deployed once again in hpux system but still it is throwing the same error. I used ant to compile in hpux system. It compiled successfully and produced jar. But while running it is throwing the same error.
Any help is highly appreciated.
Many Thanks in Advance.
You can use the target config option with a value of 1.5 so that the compiled classes are compiled to run against JVM 1.5. Also, make sure that 1.5 is the correct jvm on hpux by manually running java -version.
Read more details here
Use the cross-comilation options when compiling, specifying a source/target of 1.5, and a bootclasspath pointing to a 1.5 rt.jar
Related
This question already has an answer here:
java.lang.UnsupportedClassVersionError org/springframework/boot/loader/JarLauncher has been compiled by a more recent version of the Java Runtime
(1 answer)
Closed 3 months ago.
I wrote a fairly simple spring boot application in Java. I am on Windows, using latest intelliJ, Maven, and JDK 17. Have configured my compiler source and target to Java 11
My understanding is that I should be able to run this app in Java 11. But when I run in Java 11, I get error below:
Error: LinkageError occurred while loading main class
com.my.org.application.tester.Runner
java.lang.UnsupportedClassVersionError: org/springframework/boot/CommandLineRunner 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
55.0
I tried using Java 11 to compile but get this error when I compile:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project passport-tester: Compilation failure
I am consuming spring-boot-autoconfigure 3.0.0. Have confirmed my jdk settings are correct. When running in JDK 11 I have set JAVA_HOME, path, CLASSPATH to point to JDK11 folder
Is there any other setting I am missing, or should I check to make this work?
From https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes :
Spring Boot 3.0 requires Java 17 as a minimum version.
This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
List of Java class file format major version numbers?
(7 answers)
Closed last year.
The full error is - UnsupportedClassVersionError: net/minecraft/bundler/Main 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 60.0
I first got it when trying to update old servers, this is from a fabric server and I get the same thing when running it on my own machine with no third party.
Java is fully updated
You misunderstand the problem. It's not that the files are compiled by an older version of Java. It's that they're compiled by a newer version. You either need to update Java on the server, or downgrade Java on your own machine to match the server and then recompile everything.
try downgrading your java on your machine, like if the server needed java 8 and you have java 16, then uninstall java 16 and install java 8. it worked for me.
This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 1 year ago.
The error I met is the same as OSError: [Errno 8] Exec format error: '/Users/CodingStark/opt/anaconda3/share/jupyter/kernels/java/ijava-1.3.0.jar'. However, the answer of this post does not help me to resolve the issue.
The error is
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: io/github/spencerpark/ijava/IJava has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I tried to change "java" in the argv array described in that post to "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java" but still the same error appears. I checked the java version by java -version and it gives openjdk version "11.0.9.1". Do you have any idea why it is not working? Thank you!
The software that you are trying to run is compiled using Java 9.
You are trying to run it with Java 8. This is why error is occurring.
I checked the java version by java -version and it gives openjdk version "11.0.9.1".
This means the software you are trying to run overrides your system settings like by setting another version of Java.
You may need to check the config files and try to find Java settings.
Probably exactly this is causing an issue:
I tried to change "java" in the argv array described in that post to "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java"
This question already has answers here:
How can I get Java 11 run-time environment working since there is no more JRE 11 for download?
(4 answers)
Closed 3 years ago.
I'm trying to run a java application that I have compiled using the IntelliJ IDEA, by the commandline running the following command:
java myApp.Main
This gives me the following error:
"Exception in thread "main" java.lang.UnsupportedClassVersionError: FlightConverter/Main 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"
In IntelliJ the JRE set to run in the run configuration is: /Java/jdk-11.0.3, but I get the error above when I try to run it. When i type java -version in cmd I get "1.8.0_211"
I cant really seem to find out how to update my current JRE to match what is used by the compiler either? It seems I'm only able to find JRE 8.xx online
I'm sure you can get location of java 8 from local system and set that as a compiler in IntellIJ IDE.. This way both your system and IDE works only on Java 8 and everything will work fine...
Hope this helps...
Im having trouble using Japser Reports with Java 9.
My JasperVersions:
<dependency.version.jasper>6.5.1</dependency.version.jasper>
When trying to build my Report i get the following error Message:
An internal error occurred during: "Building report".
java.lang.UnsupportedClassVersionError: my/path/to/my/class/User has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
the Error occurrs probbably because Jasper does not Support java 9 Classes. I cant find any information on this topic, does anyone have a Idea how to write a workaround or did i do some other mistake?
EDIT:
After searching some more i realised that the problem only happens when im in the Designer in Eclipse, so it is most likely that eclipse itselve is not running in a JVM 9. I checked for the current version of java installed and it is java9, when i change the eclipse.ini file from:
-Dosgi.requiredJavaVersion=1.8
to
-Dosgi.requiredJavaVersion=1.9
i get a incompatible jvm error which says that im trying to start it with 1.8.0_161. How do i change my settings that my eclipse is acutally using my current JDK?
RESOLVED:
The error was that my Eclipse itselve only run in Java8. So my Application was building everything in Java9, like i wanted it to, but when i was inside the jasperReports Designer, the designer itselve run in java8. Thats why it crashed. The solution was to change the systemvariables and put my JavaPath over the Oracle JavaPath that for some reason had a higher priority.
Code was compiled in Java version 9 but executed in Java 8 JVM, which not necessarily works. Try compiling it in Java 8, or executing it in Java 9 JVM.