Skip to main content

//clika-runtime/io.clika.runtime/NativeLibraries

NativeLibraries

[common]
object NativeLibraries

The runtime's native libraries on a desktop JVM. A library packed in a bridge jar under native/<os>-<arch>/ (the platform ids: linux-x86_64, linux-arm64, macos-arm64, windows-x86_64, windows-arm64) is extracted once per process into a temporary directory, removed at exit, and loaded from there; a library packed nowhere on the classpath loads by name through java.library.path. An Android app ships its libraries in jniLibs, where the by-name load is the one path.

Properties​

NameSummary
platform[common]
val platform: String?
This JVM's platform id (linux-x86_64, ...), or null on a platform no bridge jar is built for; the by-name load still applies there.

Functions​

NameSummary
load[common]
fun load(name: String)
Load the library name (ClikaRT, clika_rt_jni): from the classpath resource native/<platform>/<its platform file name> when one exists, else by name. A library that loads from neither throws UnsatisfiedLinkError, as System.loadLibrary does.