File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Jar/Unjar using JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Jar/Unjar using JAVA" Watch "Jar/Unjar using JAVA" New topic

Jar/Unjar using JAVA

renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
IN UNIX and DOS, we have jar and unjar command, using which we can jar and unjar a jar file. I googled to find the how this can be done in java. Got couple of sites, but it seems to be quite big. Can anyone help me with suggesting the ways how this can be done quite simpler.

Amit Vinod Dali
Ranch Hand

Joined: Apr 14, 2010
Posts: 42
Creating jar files
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15092

The standard Java library contains classes in the package java.util.jar to work with JAR files (see what's in a JAR file, read the contents, create JAR files etc.). See the API documentation of that package for more info.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
renu richard
Ranch Hand

Joined: Oct 06, 2008
Posts: 116
what i basically do is,

1) i would need to extarct the jar,
2) Update a certain file in that extracted folder
3) Again Jar the folder passing the name.
I agree. Here's the link:
subject: Jar/Unjar using JAVA
It's not a secret anymore!