1. import net.lingala.zip4j.ZipFile;
  2. import net.lingala.zip4j.exception.ZipException;
  3. import java.io.IOException;
  4. public class SampleClass{
  5. public static void main(String[] args)
  6. throws ZipException,
  7. IOException{
  8. ZipFile zip = null;
  9. try{
  10. zip = new ZipFile
  11. ("myzip.zip");
  12. zip.extractAll("extracted");
  13. }
  14. finally{
  15. if(zip != null)
  16. zip.close();
  17. }
  18. System.out.println
  19. ("main thread end");
  20. }
  21. }