Class Chilkat2Native

java.lang.Object
com.chilkatsoft.chilkat2.Chilkat2Native

public final class Chilkat2Native extends Object
Loads the native library (chilkat2java) once per JVM. The order is:
  1. the directory named by the system property chilkat2.library.path, if set;
  2. the classpath resource /com/chilkatsoft/chilkat2/native/<platform>/<library> (an application that bundles the library in its own jar), extracted to ~/.chilkat2/<version>/<platform>/ (or java.io.tmpdir, or the directory named by chilkat2.extract.dir) and loaded from there;
  3. System.loadLibrary("chilkat2java"): java.library.path.
Platform strings: windows-x86, windows-x86_64, windows-aarch64, linux-x86_64, linux-aarch64, linux-armv7, linux-musl-x86_64, linux-musl-aarch64, macos-x86_64, macos-aarch64.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    The Chilkat version this jar was generated for.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Loads the native library if it is not loaded yet.
    static String
    Where the native library was loaded from (null before ensureLoaded()).
    static boolean
    Whether the running JVM is on Windows (the Windows-only classes check this).
    static String
    The platform string of the running JVM: the directory name of a bundled library (/com/chilkatsoft/chilkat2/native/<platform>/) and of the extraction directory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • ensureLoaded

      public static void ensureLoaded()
      Loads the native library if it is not loaded yet. Every Chilkat2 class calls this from its static initializer; applications may call it early to surface a loading problem at startup.
      Throws:
      UnsatisfiedLinkError - if no library could be loaded; the message lists where it looked
    • getLoadedFrom

      public static String getLoadedFrom()
      Where the native library was loaded from (null before ensureLoaded()).
      Returns:
      a file path or "java.library.path"
    • platform

      public static String platform()
      The platform string of the running JVM: the directory name of a bundled library (/com/chilkatsoft/chilkat2/native/<platform>/) and of the extraction directory.
      Returns:
      <os>-<arch>, with linux-musl- for Alpine
    • isWindows

      public static boolean isWindows()
      Whether the running JVM is on Windows (the Windows-only classes check this).
      Returns:
      true on Windows