JNI Error even though Java is the latest version - java

I've been trying to run a jar file with a class version 59.0, however it always gives me a JNI error saying I can only run class file versions up to 52.0
This is weird because I am on the latest version of Java and have restarted my computer.
This is the error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: MapConverter 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 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Please help!

Nevermind, I was downloading the "latest" version of java from the wrong page. I'm running Java 8.

Related

Apache James Installation Issue - java.lang.UnsupportedClassVersionError:

I am trying to install apache james 3.3.0 in windows 7 service pack 1, in which both jd 1.7, and 1.8 already installed. But while running the james i am getting the below error.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ja
mes/app/spring/JamesAppSpringMain : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
jdk installation directory
This error comes from lower version of jvm. It means you are trying to run java 8 compiled jar with java 7 jvm.
Therefore java 7 says that class version is not recognized. You need to configure JAVA_HOME points 8 then re-run.
You can find what class version is supported by which jvm https://en.wikipedia.org/wiki/Java_class_file#General_layout
This worked for me: I added
wrapper.java.command=/toolbox/jdk1.8.0_192/bin/java
near the top of conf/wrapper.conf .

JNI error after converting jar to exe using launch4j

After using launch4j to convert my jar file into exe it gives me a JNI error that tells me to check my installation and try again after that it gives me another warning that says a java exception occured.
I've tried different ways such as choosing different options but it still doesn't work.
here is the log:
Exception in thread "main" java.lang.UnsupportedClassVersionError: fluidDynamicsProject/FluidDynamicSerial 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
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
It means that the version of the JVM that is used by launch4j to run the program is less recent than the version of the compiler that compiled class fluidDynamicsProject/FluidDynamicSerial. You can try to set the minimum version in the launchj4 configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
...
<jre>
...
<minVersion>11.0</minVersion>
...
</jre>
</launch4jConfig>
Note that it's possible that launch4j doesn't support the latest versions of Java.
Or else, you can lower the target version you use to compile your classes.

Animation.jar in java runtime environment

I am using netbeans IDE.I have imported a animation.jar in my project for better gui experience,if i execute it in netbeans,it works fine.But, after i compiled and build the project.I copied the dist folder to desktop and run my project the animation is no longer running please help me,thanks in advance,sorry for bad english.
this are the errors sir after i convert it to .exe app using launch4j. I bundled it in jre6..in jre1.8 ir latest jre the problem is the my switching icons are not working..
Executing: C:\Users\syracuse\Desktop\dist\Alumni.exe
Exception in thread "main" java.lang.UnsupportedClassVersionError: AppPackage/AnimationClass : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at alumni.login.<init>(login.java:28)
at alumni.Alumni.main(Alumni.java:18)

Is it possible to auto-update install4j bundled JRE

I've got an install4j question.
I was wondering if it is possible to update the bundled JRE of an application that is already installed.
For example, in our application we had a bundled java 6. Now, we upped the minimum version to java 7 and we bundle JRE 8.
For new installations this works fine. But with existing installs, but JRE 8 is not downloaded in the update process, and after updating the application gives an error at startup:
java.lang.UnsupportedClassVersionError: camMan/shared/E/p : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at camMan.c.b.s.<clinit>(Unknown Source)
at camMan.unsecure.LoginLauncher.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.exe4j.runtime.WinLauncher.main(Unknown Source)
at com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
I'm using install4j version 5.1.15.
- We use a dynamic bundle (download on demand)
- "install as a shared JRE" is disabled
- "install only if no other suitable JRE is found" is enabled.
Thanks in advance!

jar file not working with Java8

We have a jar file, which was compiled with java 1.6, and it was working fine.
Last month system were upgraded with java 8.
and now the java code gives the following error -
F:\globaltl\ConcurDump>java -jar ConcurDumpProcessLatest.jar prod
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
ontext/ApplicationContext
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.Applica
tionContext
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Is this issue because of the version upgrade?
The same jar used to work fine with older java version.

Categories

Resources