I am trying to launch my application on java 8u231, but it failed with error "A JNI error has occurred, please check your installation and try again". However, the same application can be launched on java 8u102.
java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
PATH=%PATH%;.\lib
java -D... -Xmx512m MyFullApplication
11/18-16:23:49.00356 [main#1] jdk.internal.event.EventHelper.logX509CertificateEvent
FINE: X509Certificate: Alg:{0}, Serial:{1}, Subject:{2}, Issuer:{3}, Key type:{4}, Length:{5}, Cert Id:{6}, Valid from:{7}, Valid until:{8}
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NullPointerException
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.ensureInitialization(Unknown Source)
at java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(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)
I am launching my application from command line but not from the Eclipse. The jar file is pre-built and I can launch the jar with java 8u102 and java 8u221, but it can not be launched by java 8u231, so I guess is there bug of JRE itself which introduced this issue?
Related
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 .
I already tried jarfix and jar runner and the cmd command("javaw.exe -jar .jar" and it was written that [unable to access .jar])
here is my java version:
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
tried:
1.java -jar "C:\Path to File\myJar.jar"
result:fail
Stacktrace:
Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: joptsimple/OptionException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: joptsimple.OptionException
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)
... 7 more
If there are spaces in the path this can cause such a failure. Even if it is the current directory.
So write something like this:
java -jar "C:\Path to File\myJar.jar"
Otherwise it might be a permissions issue. Check the file permissions.
I'm using version 4.2.0 of the JNA libraries from here: https://github.com/java-native-access/jna.
My application works absolutely fine on Java 7 & 8 32-bit on a 64-bit Windows 7.1 machine.
When I try to load it using Java 6 32-bit, I get this error:
java.lang.reflect.InvocationTargetException
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.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\user\AppData\Local\Temp\jna-205523658\jna1343790277438028829.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
at com.sun.jna.Native.<clinit>(Native.java:140)
at com.sun.jna.Pointer.<clinit>(Pointer.java:41)
at com.sun.jna.platform.win32.WinReg$HKEY.<init>(WinReg.java:32)
at com.sun.jna.platform.win32.WinReg.<clinit>(WinReg.java:61)
Is this an incompatibility issue between 32-bit Java 6 on a 64-bit OS? Is there anything I can do about it?
My problem is that I need to deploy my app to a wide user base all with different permutations of Java 32-bit on different Windows operating systems.
I am trying to run java desktop application using command line.In this application I am using the serial port to communicate ans send and receive request and response.So i am using the RXTXserail.dll file and RXTXcomm.jar file.I am creating the application using net beans 7.1 version under the windows 7 OS.
It was running from net beans plate form but when i try to run the application jar file that time i am getting this below error
"C:\configurationtool\ModbusZigBee\dist>java -jar ModbusZigBee.jar
java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jre6\bin\rxtxSerial.dll: C
an't load IA 32-bit .dll on a AMD 64-bit platform thrown while loading gnu.io.RX
TXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\Progra
m Files\Java\jre6\bin\rxtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit
platformSubstance Raven Graphite failed to initialize
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at modbuszigbee.SerialInterface.<init>(SerialInterface.java:58)
at modbuszigbee.ModbusZigBeeView.<init>(ModbusZigBeeView.java:111)
at modbuszigbee.ModbusZigBeeApp.startup(ModbusZigBeeApp.java:22)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)"
I am using 32 bit java 6 in my system. and rxtxserial.dll also 32 bit.i tried with 64 bit of rxtxserial.dll.But it did not work.
Please help.Thanks in advance.
When i compile and run my program in eclipse, it works.
When i run my .jar program on my personal computer (Windows 8 with java JDK 7), it works.
But when i'm trying to run .jar in others computers, it doesn't work.
So i tried to run with command line java -jar myjar
and i got this message which i can't understand
java -jar "Bureau\Application SNCF\SNCF.jar"
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
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.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 java.lang.ClassLoader.loadClassInternal(Unknown Source)
Does anyone understand this message error?
Thanks for your help
This is always caused by the conflict of different Java JDK at compile time and runtime, make sure you are using same JDK version to compile and run it.