maven:需要加上这个下载这两个包
net.sf.sevenzipjbinding
sevenzipjbinding
9.20-2.00beta
net.sf.sevenzipjbinding
sevenzipjbinding-all-platforms
9.20-2.00beta
普通的架构:需要自己下载
sevenzipjbinding-9.20-2.00beta.jar
sevenzipjbinding-all-platforms-9.20-2.00beta.jar
/**
*
* @Description (解压7z)
* @param file7zPath(7z文件路径)
* @param outPutPath(解压路径)
* @param passWord(文件密码.没有可随便写,或空)
* @return
* @throws Exception
*/
public static int un7z(String file7zPath, final String outPutPath, String passWord) throws Exception {
IInArchive archive;
RandomAccessFile randomAccessFile;
randomAccessFile = new RandomAccessFile(file7zPath, "r");
archive = SevenZip.openInArchive(null, new RandomAccessFileInStream(randomAccessFile), passWord);<