From c8fede9ea2c6b88b5d93fc3167bde693b6a87ffb Mon Sep 17 00:00:00 2001 From: Darius Maitia Date: Tue, 1 Oct 2024 16:59:16 +0200 Subject: [PATCH] Native lib loading refactor (#250) --- zenoh-kotlin/src/jvmMain/kotlin/io/zenoh/Zenoh.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zenoh-kotlin/src/jvmMain/kotlin/io/zenoh/Zenoh.kt b/zenoh-kotlin/src/jvmMain/kotlin/io/zenoh/Zenoh.kt index 11ae638c..01e4f180 100644 --- a/zenoh-kotlin/src/jvmMain/kotlin/io/zenoh/Zenoh.kt +++ b/zenoh-kotlin/src/jvmMain/kotlin/io/zenoh/Zenoh.kt @@ -108,7 +108,7 @@ internal actual object ZenohLoad { } private fun loadLibraryAsInputStream(target: Target): Result = runCatching { - val libUrl = ClassLoader.getSystemClassLoader().getResourceAsStream("$target/$target.zip")!! + val libUrl = javaClass.getResourceAsStream("$target/$target.zip")!! val uncompressedLibFile = unzipLibrary(libUrl) return Result.success(FileInputStream(uncompressedLibFile.getOrThrow())) }