RAR libraries for Java
For Java, junrar is the library to use. It’s pure Java (no native code), extracts RAR4 and RAR5 archives including passwords, encrypted headers and volumes, and has both a one-line Junrar.extract helper and a streaming Archive API. Its code derives from the UnRAR source, so it carries the UnRAR license restriction: free to use for extraction, not for building a RAR archiver.
Apache Commons Compress doesn’t support RAR. If you already use the 7-Zip native binding SevenZipJBinding, it extracts RAR too, at the cost of a platform-specific native library.
- junrar junrar is a pure Java library that extracts RAR4 and RAR5 archives. How to add it with Maven or Gradle, extract and list RAR files, read entries as streams.