import java.io.*; import java.util.*; import java.util.jar.*; public class JarView { /** * main() */ public static void main(String[] args) throws IOException { // Open the jar file, using the first command line argument as the file // name. JarFile jar = new JarFile(args[0]); // Process the jar file. Close it when the block is exited. try { // Loop through the jar entries and print the name of each one. for (Enumeration list = jar.entries(); list.hasMoreElements(); ) { JarEntry entry = (JarEntry) list.nextElement(); System.out.println(entry.getName()); } } finally { jar.close(); } } }