7z libraries for Java
The JDK has no 7z support. The standard choice is:
- Apache Commons Compress: pure Java, reads 7z with LZMA, LZMA2, BZip2, Deflate, Deflate64, Delta, BCJ filters and AES-256 encryption, and writes LZMA2, BZip2, Deflate or stored archives. It needs the XZ for Java library for LZMA and LZMA2. The same library handles ZIP, TAR, CPIO, AR and the compressors gzip, bzip2, xz, zstd and brotli.
7-Zip-JBinding, a JNI wrapper of the native 7-Zip library, supports every 7-Zip method but hasn’t had a release since 2016.
- Commons Compress Apache Commons Compress reads and writes 7z archives in pure Java. How to add it with Maven or Gradle, list and extract a 7z file, open encrypted archives.