Convert TAR to JAR
Repackage TAR contents as a JAR with 7-Zip or the JDK jar command.
Convert TAR files online
We don’t have a dedicated online converter for TAR to JAR yet, but you can convert TAR files online to these and more formats:
Want to convert TAR to JAR?
Let us know. We pick the conversions to add next by how many people ask for them.
How to convert tar to jar file
- Archives
- No ratings yet.
A Java tool or deployment workflow may accept only a JAR even when the available files arrive in a TAR archive. Repackaging changes the container format; it does not compile code or make arbitrary files executable.
What the tar format is
TAR (Tape Archive) bundles files and directories and is commonly used for Unix/Linux backups, source-code distributions, and software packages. A plain .tar file is not compressed; formats such as .tar.gz and .tar.xz add compression. TAR can store filesystem metadata such as permissions and timestamps.
What the jar format is
JAR (Java Archive) is a ZIP-based format used for Java classes, libraries, and resources. Java tools and archive utilities can inspect it, and a manifest can store attributes such as an application's main class. A JAR can also hold ordinary files, but it runs with java -jar only if it is set up as an application.
How to convert a tar archive to a jar
With 7-Zip: extract the TAR, then create a ZIP archive using a .jar filename. 7-Zip does not create a JAR format directly, but a ZIP archive named with the .jar extension is suitable as a JAR archive.
- Extract
input.tarto a new folder with 7-Zip → Extract files…. For.tar.gzor.tar.xz, extract the compressed layer first, then extract the resulting TAR. - Select the extracted files and folders—not just their parent folder—and choose 7-Zip → Add to archive…. Set Archive format to
zipand name the outputoutput.jar. - Optionally verify the archive with a JDK installed by running
jar --list --file output.jar. The command lists entries but does not test whether an application can run.
To create a runnable application JAR with a JDK, ensure the compiled main class is among the extracted files and run this from the folder containing extracted: jar --create --file app.jar --main-class com.example.Main -C extracted .. Replace com.example.Main with the fully qualified name of the actual main class. This adds the main-class manifest attribute; external dependencies still need to be available on the application's class path unless they are packaged separately or included in a suitable combined archive.
Compatibility and limitations
Renaming a TAR to .jar does not convert it. Repacking preserves file contents in ordinary cases, but TAR-specific ownership, permissions, timestamps, and symbolic-link behavior may not carry over to JAR. A JAR without a main-class manifest can still serve as a library or resource archive, but it will not launch with java -jar. Local tools avoid uploading archive contents to an online converter.
TAR vs JAR: format comparison
How the TAR and JAR formats compare on the properties that matter most for this conversion.
| Property | .TAR Tape Archive | .JAR Java Archive |
|---|---|---|
| Compression | Uncompressed | Both |
| Compression ratio | — | Medium |
| Encryption | No | Yes |
| Split archives | No | No |
| Recovery record | No | No |
| Operating system support | Wide | Wide |
| Typical file size | Large | Medium |
| Open standard | Yes | Yes |
| Introduced | 1979 | 1996 |
| Developer | AT&T Bell Laboratories | Oracle (originally Sun Microsystems) |
| MIME type | application/x-tar | application/java-archive |
Information about file extensions and file types is provided by File-Extensions.org