Support This Project Logo
LogoLogo Big

What's this all about?

7-Zip-JBinding is a java wrapper for 7-Zip C++ library. It allows extraction of many archive formats using a very fast native library directly from java through JNI. Features:

  • Extract
    7-Zip Zip Rar Tar Split Lzma Iso HFS GZip
    Cpio BZip2 Z Arj Chm Lhz Cab Nsis
    Deb Rpm Wim Udf
  • Create/update
    7-Zip Zip GZip Tar BZip2
  • It's cross-platform. Binaries are available for
    › MS-Windows 32/64 › Linux 32/64 › Darwin Mac OS X › ARM
  • Full support for extraction of password protected and volumed archives
  • In-memory archive creation/update/extraction
  • Artifacts on Maven central (coming soon)
  • 22 example code snippets
  • Over 6766 JUnit tests: Dashboard
  • Planned: Creation/update of password protected and volumed archives
  • Planned: Extraction of more archive formats supported by 7-Zip
  • Known bug: JVM crash in case of OutOfMemory exception.
    Workaround: Increase heap using -Xmx parameter.

How does it work?

The 7-Zip-JBinding consists of two parts: the java part and the native part. The java part introduces a cross-platform java interface of the 7-Zip library. The native part of 7-Zip-JBinding communicates with the java part through the java jni interface and uses the corresponding native 7-Zip interface to perform operations.


It's really simple!

Getting number of packed items in an archive:

private int getNumberOfItemsInArchive(String archiveFile) throws Exception {
    IInArchive archive;
    RandomAccessFile randomAccessFile;

    randomAccessFile = new RandomAccessFile(archiveFile, "r");

    archive = SevenZip.openInArchive(ArchiveFormat.ZIP, // null - autodetect
            new RandomAccessFileInStream(

    int numberOfItems = archive.getNumberOfItems();


    return numberOfItems;

For the sake of simplicity all error handling was skipped. Continue with first steps for more examples and explanations.


6 Oktober 2015: 7-Zip-JBinding Release: 9.20-2.00beta

Release candidate, extraction & compression, cross-platform, based on 7zip/p7zip 9.20
  • New feature: Create/update archives
    • Supported archives: 7z, Zip, Tar, GZip, BZip2
    • Archive format specific or generic compression APIs
    • JavaDoc + Snippets
    • More than 1500 additional JUnit tests
  • New feature: Get 7-Zip-JBinding and 7-Zip version information
  • New platform: ARM
  • Improvement: SHA1 hashes are used to verify cached binaries in the temp directory
  • Improvement: Performance boost on Linux (using -O2 optimization )
  • API changes
  • Bugfix: #17 WIM archive format contains Udf comment
  • Add compressed web site ( to the distribution

16 Januar 2013: 7-Zip-JBinding Release: 4.65-1.06rc-extr-only

Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65
  • Feature: WIM format support + tests
  • Feature: Initialization performance boost. Don't delete extracted native libraries in the temporary directory (specified by<dir>) and use those later during subsequent 7-Zip-JBinding initializations.
  • Test: Test cross-platform encoding functionality
  • Bugfix: Get ride of the dependency to USER32.DLL improving performance and robustness
  • Bugfix: 7-Zip-JBinding compiles now with gcc 4.7 (Bug ID: 3593757)
    Special thanks to Daniel Santos for the provided patch!
  • Bugfix: Simple Interface returns wrong CRC (Bug ID: 3535546)
    Special thanks to M. Hamer

24 April 2012: 7-Zip-JBinding Release: 4.65-1.05rc-extr-only

Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65
  • Bugfix: Multipart CAB-archive extraction without implementing IArchiveOpenVolumeCallback
  • Bugfix: A general protection fault raises when trying to list files in passworded RAR archive. The password length is 30+ characters.
  • Feature: Initialize native module within a AccessController#doPrivileged block

8 March 2010: 7-Zip-JBinding Release: 4.65-1.04rc-extr-only

Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65
  • Bugfix: it was not possible to open some archives over 4GB
    Special thanks for IKVM developer Jeroen Frijters for finding this bug!

9 December 2009: 7-Zip-JBinding Release: 4.65-1.03rc-extr-only

Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65
  • Binary version for MacOS 64 bit (java 6)
  • Support for multi-platform jars. Multi-platform releases:
    • AllPlatforms - all available native libraries in a single jar
    • AllWindows - native libraries for Windows 32 and 64
    • AllLinux - native libraries for Linux 32 and 64
    • AllMac - native libraries for Mac 32 and 64
  • Initialization reworked. See JavaDoc for SevenZip for more information.
  • Integration test for all platforms for single and multiple platform distributions
  • Improved ISevenZipInArchive.extract(): Sort indices, if not already sorted, bug fixes.
  • DEB format support + tests
  • RPM format support + tests
  • UDF format support + tests
  • New Code snippets: opening multi-part 7z and RAR archives
  • Source code repository: moved from svn to git

9 October 2009: 7-Zip-JBinding Release: 4.65-1.02rc-extr-only

Bugfix release (Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65)
  • Binary version for Windows 64 XP and above (amd64)
  • NSIS format support + tests
  • New method ISevenZipInArchive.getArchiveFormat() returns format of the opened archive, even if archive format auto-detection was used.
  • Better performance for archive format auto-detection

1 September 2009: 7-Zip-JBinding Release: 4.65-1.01rc-extr-only

Bugfix release (Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65)
31 July 2009: 7-Zip-JBinding Release: 4.65-1.0rc-extr-only

The first cross-platform release of Java wrapper for 7-Zip library was build!
Main features of 4.65-1.0rc-extr-only (Release candidate, extraction only, cross-platform, based on 7zip/p7zip 4.65)
  • Extraction of 7z, Zip, Tar, Split, Rar, Lzma, Iso, HFS, GZip, Cpio, BZIP2, Z, Arj
  • Support for password protected and volumed archives
  • Compression method auto detection
  • Simple extraction interface
  • Cross-platform. Binaries available for
    • Windows 32
    • Linux 32/64
    • Mac OS X
  • Over 3000 JUnit tests extraction of archive formats: 7z, Arj, BZip2, Cpio, GZip, ISO, Lzma, Rar, Tar, Z, Zip
  • 7-Zip-JBinding requires Java 1.5 or higher

30 January 2009: 7-Zip-JBinding Release: 0.4.1
  • Bug fixed: 2525877 (Memory leak)

4 January 2009: 7-Zip-JBinding Release: 0.4
  • Full rework of c++ code: thread safe JNI-calls, correct exception handling between threads
  • Bug #2441909 fixed (Can't extract encrypted 7-Zip files)
  • New open/extract method for crypted archives and items (standard and simple interface)
  • JUnit tests for the extraction of crypted archives and exception handling
  • New examples on the home page
more news