Skip to content
Mkyong.com
Mkyong.com
  • Java Frameworks 2025
  • Micronaut
  • Spring Boot
  • Java 8
  • Contact

commons-compress

How to create tar.gz file in Java

March 12, 2025August 13, 2020 by mkyong

In this tutorial, we will use the Apache Commons Compress library for handling TAR and GZ compression or tar.gz file. Table of Contents: 1. What is tar.gz? 2. Adding Dependencies 3. Creating a tar.gz File in Java 4. Extracting a tar.gz File in Java 5. Adding Files or Directories to an Existing tar.gz File 6. …

Read more

Categories java Tags commons-compress, compress file, gzip, java, zip 3 Comments

Mkyong.com has provided Java and Spring tutorials, guides, and code snippets since 2008. All published articles are simple, easy to understand, and well-tested in our development environment.

Mkyong.com licenses all source code on this website under the MIT License.

Tools
  • Spring Framework
  • Quarkus Framework
  • Micronaut Framework
  • Oracle Java JDK
  • Eclipse Temurin JDK
  • OpenJDK JDK
  • Hibernate ORM
  • Maven Build Tool
  • Gradle Build Tool
  • Tomcat Application Server
  • Docker
Links
  • Maven Central
  • Docker Hub
  • Spring Guides
  • Quarkus Guides
  • Micronaut Guides
  • Martin Fowler
  • AskPython
About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
© 2026 Mkyong.com - Build with Love.