Packages

class NativeLoader extends Serializable

A helper class for loading native libraries from Java

Some Java interfaces depend on native libraries that need to be loaded at runtime. This class is a simple utility that can load the native libraries from a jar in one of two ways:

  • By name: If a particular native library is needed, it will extract it to a temp folder (along with its dependencies) and load it from there.
  • All libraries: all libraries will be extracted to a temp folder and the libraries in the load manifest are loaded in the order provided, or loaded in the order specified in the native manifest if no load manifest is provided.

The jar with the native libraries must contain a file name 'NATIVE_MANIFEST' that lists all native files (one per line, full name) to be extracted. If the loadAll() method is used, the libraries will be loaded in the order specified in the manifest. The native libraries should be in folders describing the OS they run on: linux, windows, mac.

Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NativeLoader
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NativeLoader(topLevelResourcesPath: String)

Value Members

  1. def loadLibraryByName(libName: String): Unit

    Loads a named native library from the jar file

    Loads a named native library from the jar file

    This method will first try to load the library from java.library.path system property. Only if that fails, the named native library and its dependencies will be extracted to a temporary folder and loaded from there.