Extract 20+ archive formats — 7z, ZIP, RAR, TAR, XZ and more — and create 7z, ZIP, TAR, GZip, BZip2 & XZ, with the real 7-Zip engine and native performance. One small library, every platform, no external tools. All I/O is callback-driven: run fully in memory, stream from any source — even a remote archive fetched piece by piece — and abort at any time.
Not a wrapper around an external binary: the engine is compiled into a small native library, driven through JNI by a clean Java interface.
7z, ZIP, RAR/RAR5, TAR, GZip, BZip2, XZ, ISO, CAB, NTFS, … — with archive-format auto-detection, password support and multi-volume archives.
The original 7-Zip 23.01 C/C++ engine, running in-process. Stream-based: extract from and compress to memory, files or your own I/O callbacks.
Write 7z, ZIP, TAR, GZip, BZip2 and XZ. Update existing archives in place — add, replace and remove items without repacking everything.
Windows, Linux (glibc & musl/Alpine, x86 & ARM v5–v8) and macOS (universal: Intel + Apple Silicon). Runtime auto-detection picks the right native library.
Open and create password-protected archives, including 7z header encryption and encrypted RAR5 archives.
8845 JUnit tests, run on every supported platform — real VMs, real ARM hardware, both with the per-platform jar and the all-platforms jar.
Your code talks to a small Java API. Behind it, a single native library contains the C++ binding layer and the unmodified 7-Zip engine — no external processes, no temp executables, no shelling out.
Extraction and compression never touch the disk unless you want them to. The engine asks for bytes — your code decides where they come from and where they go. That unlocks patterns that are impossible with an external unzip tool:
Example: extract two files from a 40 GB remote backup — your
IInStream serves the engine's reads via HTTP range requests, downloading
megabytes instead of gigabytes. See the snippets →
Add the API jar and the native-libraries jar from Maven Central. The right native library is detected and loaded at runtime.
<dependency>
<groupId>net.sf.sevenzipjbinding</groupId>
<artifactId>sevenzipjbinding</artifactId>
<version>23.01-2.2</version>
</dependency>
<dependency>
<groupId>net.sf.sevenzipjbinding</groupId>
<artifactId>sevenzipjbinding-all-platforms</artifactId>
<version>23.01-2.2</version>
</dependency> implementation("net.sf.sevenzipjbinding:sevenzipjbinding:23.01-2.2")
implementation("net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:23.01-2.2") implementation 'net.sf.sevenzipjbinding:sevenzipjbinding:23.01-2.2'
implementation 'net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:23.01-2.2' libraryDependencies += "net.sf.sevenzipjbinding" % "sevenzipjbinding" % "23.01-2.2"
libraryDependencies += "net.sf.sevenzipjbinding" % "sevenzipjbinding-all-platforms" % "23.01-2.2" <dependency org="net.sf.sevenzipjbinding" name="sevenzipjbinding" rev="23.01-2.2"/>
<dependency org="net.sf.sevenzipjbinding" name="sevenzipjbinding-all-platforms" rev="23.01-2.2"/> RandomAccessFile file = new RandomAccessFile("archive.7z", "r");
try (IInArchive archive = SevenZip.openInArchive(null, // autodetect format
new RandomAccessFileInStream(file))) {
for (ISimpleInArchiveItem item : archive.getSimpleInterface().getArchiveItems()) {
System.out.println(item.getPath() + " (" + item.getSize() + " bytes)");
}
}Want more? Every example on this site is a real, tested program — its output is verified by the test suite on every release. Browse the code snippets →
Ship -all-platforms and forget about it — or pick a single
platform jar to keep your artifact small.
7-Zip engine 23.01 · Java 8 baseline · XZ compression · Apple Silicon · musl/Alpine builds · runtime platform auto-detection