Installing the Chilkat Java Library on Windows
How to add the Chilkat Java library to a Windows project, 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, …).
- JVM architecture — a 64-bit JVM needs the x64 download, a 32-bit JVM needs the win32 download. This is the JVM's bitness, not the Windows version (Step 3).
-
Download & unzip
Get the build for your JDK from the Chilkat Windows Java Downloads and unzip it to any directory.
-
What's in the download
chilkat-jdk<version>-<arch>/ ├─ chilkat.jar the Chilkat Java classes (put on the classpath) ├─ chilkat.dll the native JNI library (put on java.library.path) ├─ Test.java a small verification program ├─ runTest.bat compiles and runs Test.java ├─ AsyncHttp.java example ├─ HttpWithEvents.java example ├─ MyHttpProgress.java example ├─ runAsyncHttp.bat ├─ runHttpWithEvents.bat ├─ Install_Instructions.txt ├─ license.pdf ├─ pcre2-license.pdf └─ quickjs-license.pdf
Two files, two roles:chilkat.jargoes on the Java classpath;chilkat.dllis the native library that must be on the java.library.path (e.g. the working directory, or a directory you pass with-Djava.library.path). -
Check your JVM architecture
java -version
A 64-bit JVM reports something like “64-Bit Server VM” — use the x64 download. A 32-bit JVM has no such marker — use the win32 download. The Chilkat DLL's bitness must match the JVM, or you'll get an
UnsatisfiedLinkError(see below). -
Verify with runTest.bat
From the unzipped directory, run:
runTest.bat
It compiles and runs
Test.java, which loads the native DLL (System.loadLibrary("chilkat")), loads the Chilkat classes fromchilkat.jar, instantiates aCkZip, and prints its version:11.5.0For reference,
runTest.batruns: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 containingchilkat.dll:javac -classpath ".;path\to\chilkat.jar" YourApp.java java -Djava.library.path=path\to\dll -classpath ".;path\to\chilkat.jar" YourApp
See also: Using System.loadLibrary to load a native DLL and JAR archives and classpath on Windows.
-
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.
Common errors
“UnsatisfiedLinkError: no chilkat in java.library.path”
The JVM can't find chilkat.dll. Run from the directory containing the DLL,
or pass -Djava.library.path=<dir> pointing at it.
“UnsatisfiedLinkError: Can't load IA 32-bit .dll on a AMD 64-bit platform” (or the reverse)
The DLL's architecture doesn't match the JVM. Use the x64 download for a 64-bit JVM and the win32 download for a 32-bit JVM (Step 3).
“NoClassDefFoundError” / “ClassNotFoundException: com.chilkatsoft.CkZip”
chilkat.jar isn't on the classpath. Add it with
-classpath ".;path\to\chilkat.jar" when compiling and running.