All formats

CBR libraries for Java

junrar is the pure-Java RAR reader. It reads RAR 1.5-4.x archives, including solid, multi-volume and password-protected ones, but not RAR5, the default format of WinRAR 5.0 and later: opening a RAR5 file throws UnsupportedRarV5Exception. Most CBR files from scanning groups are RAR4, but newer ones may be RAR5.

For RAR5 in Java there is no maintained pure-Java option. Call the unrar or 7z command line tool, or use a JNI binding to libarchive or 7-Zip (for example 7-Zip-JBinding, LGPL with the unRAR restriction).

Write the result as CBZ with java.util.zip or Commons Compress.