In this post, I will explain how to unzip a jar file. Below is the complete code to unzipping a jar file programmatically Main code 1 package jar; 2 3 import java.io.File; 4 import java.io.FileOutputStream; 5 import java.io.IOException; 6 import java.io.InputStream; 7 import java.util.Enumeration; 8 import java.util.jar.JarEntry; 9 import java.util.jar.JarFile; 10 11 public class JarDemo2…… Continue reading Unzipping a jar file programmatically
Category: Jar
Exploring jar files programmatically
In this post under java, I will show how to browse a jar file programmatically. For the example I will browse the mockito jar file. So I will add the “mockito-core-2.11.0.jar” in the classpath of the java file. Below is the complete code for browsing the jar file programmatically Main Code 1 package jar; 2…… Continue reading Exploring jar files programmatically
Decompressing JAR file
JAR file is file archiver which collects/groups different files and folder into a format which represents one file. The format of JAR file is an uncompressed format. Pack200 is a tool that can be used to compress and decompress a jar file. Below is a simple example of how we can use Pack200 tool to…… Continue reading Decompressing JAR file
Compressing JAR file
JAR file is file archiver which collects/groups different files and folder into a format which represents one file. The format of JAR file is an uncompressed format. Pack200 is a tool that can be used to compress jar file. Below is a simple example of how we can use Pack200 tool to compress the file…… Continue reading Compressing JAR file