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
- JDK version — pick the build for your JDK (e.g. JDK 25, 21, 17, …).
- Architecture —
x86_64,x86,aarch64, orarmv7l, matching your JVM. - C library — the standard Linux build for glibc, the Alpine build for musl. They are not interchangeable.
-
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
-
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.jargoes on the Java classpath;libchilkat.sois the native library that must be on the java.library.path (the working directory, or a directory passed with-Djava.library.path). -
Check your JVM architecture
java -version uname -m # x86_64, aarch64, armv7l, ...A 64-bit JVM reports a “64-Bit Server VM”. The
libchilkat.soarchitecture must match the JVM, or you'll get anUnsatisfiedLinkError(see below). -
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 fromchilkat.jar, instantiates aCkZip, and prints its version:11.5.0For reference,
runTest.shruns:javac -encoding utf8 -classpath ".:./chilkat.jar" Test.java java -Djava.library.path=. -classpath ".:./chilkat.jar" Test
-
Use Chilkat in your own project
Put
chilkat.jaron the classpath and pointjava.library.pathat the folder containinglibchilkat.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.
-
Unlock (30-day trial / licensed classes)
Chilkat's commercially-licensed Java classes are fully functional for a 30-day trial. Call
UnlockBundleonce 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
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.