JVM crashes when loading a native library
<p>I'm working on a CD burner using java, where ( using JNI ) i must load some native libraries (DLL). Well, i know that to load a native library using "System.loadLibrary(libName)", the library must be set to one of the "java.library.path" paths, however if using "System.load(libPath)" there is no need for that.</p>

<p>So, i used to load all my native libraries using "System.load(<code>libPath</code>)" and that worked for all of them except a single one <code>"BurnerCaller.dll"</code> that causes a <code>JVM</code> crash with the error message below.</p>

<pre><code># A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (0xe0434352), pid=2280, tid=0x00000000000013a8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [KERNELBASE.dll+0xaa7d]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Program Files\Java\MainWorkspace\NewAman\hs_err_pid2280.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
</code></pre>

<p><a href="https://www.dropbox.com/s/jju1d536mi2ek67/hs_err_pid7096.log?dl=0" rel="nofollow">Here</a> is the detailed result error.</p>

<p>The weird thing is that <strong>if and only if</strong> i put this library to the "<strong>bin</strong>" directory of the currently running <code>JRE</code> or <code>JDK</code> (that my application is using to run) it works like a charm.</p>

<p>Any help would be appreciated, thanks in advance.</p>