Playing with .jar files

For archival purposes.

Operation Command
To create a JAR file jar cf&nbsp;<em>jar-file input-file(s)</em>
To view the contents of a JAR file jar tf&nbsp;<em>jar-file</em>
To extract the contents of a JAR file jar xf&nbsp;<em>jar-file</em>
To extract specific files from a JAR file jar xf&nbsp;<em>jar-file archived-file(s)</em>
To run an application packaged as a JAR file 
(version 1.1)
jre -cp <em>app.jar MainClass</em>
To run an application packaged as a JAR file 
(version 1.2 — requires Main-Class manifest header)
java -jar <em>app.jar</em>
To invoke an applet packaged as a JAR file
&lt;applet code=<em>AppletClassName.class</em>
        archive="<em>JarFileName.jar</em>"
        width=<em>width</em> height=<em>height</em>&gt;
&lt;/applet&gt;

 

Leave a Reply

Your email address will not be published. Required fields are marked *