Installing the Chilkat Java Library on Linux

How to add the Chilkat Java library to a project on Linux (all architectures) and Alpine Linux, plus the checks that prevent the common UnsatisfiedLinkError and classpath problems.

Examples: Chilkat Java Examples  ·  Documentation: Chilkat Java Reference

Match the download to your system The Chilkat library includes a native JNI shared library, so the download must match:
  • JDK version — pick the build for your JDK (e.g. JDK 25, 21, 17, …).
  • Architecturex86_64, x86, aarch64, or armv7l, matching your JVM.
  • C library — the standard Linux build for glibc, the Alpine build for musl. They are not interchangeable.
  1. Download & extract

    Get the build for your system from the Chilkat Linux Java Downloads, then extract:

    tar xzf chilkatjava-jdk<version>-<arch>-linux.tar.gz
  2. What's in the download

    chilkatjava-jdk<version>-<arch>-linux/
    ├─ chilkat.jar             the Chilkat Java classes (put on the classpath)
    ├─ libchilkat.so           the native JNI library (put on java.library.path)
    ├─ Test.java               a small verification program
    ├─ runTest.sh              compiles and runs Test.java
    ├─ license.pdf
    ├─ pcre2-license.pdf
    ├─ quickjs-license.pdf
    └─ THIRD-PARTY-NOTICES.txt
    Two files, two roles: chilkat.jar goes on the Java classpath; libchilkat.so is the native library that must be on the java.library.path (the working directory, or a directory passed with -Djava.library.path).
  3. Check your JVM architecture

    java -version
    uname -m            # x86_64, aarch64, armv7l, ...

    A 64-bit JVM reports a “64-Bit Server VM”. The libchilkat.so architecture must match the JVM, or you'll get an UnsatisfiedLinkError (see below).

  4. Verify with runTest.sh

    From the extracted directory:

    ./runTest.sh

    It compiles and runs Test.java, which loads the native library (System.loadLibrary("chilkat")), loads the Chilkat classes from chilkat.jar, instantiates a CkZip, and prints its version:

    11.5.0

    For reference, runTest.sh runs:

    javac -encoding utf8 -classpath ".:./chilkat.jar" Test.java
    java -Djava.library.path=. -classpath ".:./chilkat.jar" Test
  5. Use Chilkat in your own project

    Put chilkat.jar on the classpath and point java.library.path at the folder containing libchilkat.so (note Linux uses : as the classpath separator):

    javac -classpath ".:path/to/chilkat.jar" YourApp.java
    java -Djava.library.path=path/to/so -classpath ".:path/to/chilkat.jar" YourApp

    See also: Using System.loadLibrary to load a native .so and JAR archives and classpath on Linux.

  6. Unlock (30-day trial / licensed classes)

    Chilkat's commercially-licensed Java classes are fully functional for a 30-day trial. Call UnlockBundle once at the start of your program (any string starts the trial; use your license code after purchase):

    import com.chilkatsoft.CkGlobal;
    
    CkGlobal glob = new CkGlobal();
    boolean success = glob.UnlockBundle("Anything for 30-day trial");
    if (success == false) {
        System.out.println(glob.lastErrorText());
    }

    The Chilkat Java library contains both freeware and commercial classes; each is marked in the reference documentation.


Notes for Alpine Linux

Use the Alpine download, which is built for musl libc — the standard Linux (glibc) build will not load on Alpine. All other steps are identical.

Common errors

“UnsatisfiedLinkError: no chilkat in java.library.path”

The JVM can't find libchilkat.so. Run from the directory containing it, or pass -Djava.library.path=<dir> pointing at it (or add that directory to LD_LIBRARY_PATH).

“UnsatisfiedLinkError: ... wrong ELF class” or “cannot open shared object file”

Architecture or C-library mismatch — e.g. a 32-bit .so under a 64-bit JVM, the wrong CPU architecture, or a glibc build on Alpine (musl). Re-check Step 3 and use the matching download.

“NoClassDefFoundError” / “ClassNotFoundException: com.chilkatsoft.CkZip”

chilkat.jar isn't on the classpath. Add it with -classpath ".:path/to/chilkat.jar" when compiling and running.