Skip to content

Commit 87f012c

Browse files
committed
Fixed loading native library in Java 8
fixed NullPointerException when using Java8, loading the library with the Bootstrap classloader
1 parent dccf1fd commit 87f012c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/src/main/java/com4j/COM4J.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ private static void loadNativeLibrary() {
545545
final String fileName = "com4j-" + System.getProperty("os.arch") + ".dll";
546546

547547
// try loading com4j.dll in the same directory as com4j.jar
548-
URL res = COM4J.class.getClassLoader().getResource("com4j/COM4J.class");
548+
URL res = COM4J.class.getResource("/com4j/COM4J.class");
549549
String url = res.toExternalForm();
550550
if(url.startsWith("jar:")) {
551551
int idx = url.lastIndexOf('!');

0 commit comments

Comments
 (0)