Jar

run
java -jar jarFile.jar


make jar
jar cvf0 TicTacToe.jar TicTacToe.class audio images

c: create jar file
v: verbose output dtail of jar making process
f: ?
0: no compression
jarfileNameDesired
resources to be jared separated by space - directories will be added recursively


extract jar:
jar xf jarFile.jar

x: extract

Explicitly choose the class to run (class Main in package foo)
jar cfe Main.jar foo.Main foo/Main.class




META-INF/MANIFEST.MF

Type your specific manifest in a file e.g. manifest.txt
jar cfm MyJar.jar Manifest.txt MyPackage/*.class




Main-Class: com.package.MyMainClass


Specifying details for each package used
Headers in a manifest Header     Definition
Name                             The name of the specification.
Specification-Title            The title of the specification.
Specification-Version       The version of the specification.
Specification-Vendor        The vendor of the specification.
Implementation-Title         The title of the implementation.
Implementation-Version    The build number of the implementation.
Implementation-Vendor     The vendor of the implementation.

e.g.
Name: java/util/
Specification-Title: Java Utility Classes
Specification-Version: 1.2
Specification-Vendor: Sun Microsystems, Inc.
Implementation-Title: java.util
Implementation-Version: build57
Implementation-Vendor: Sun Microsystems, Inc.

seal a package ???
Sealed: true

sign a jar file


Comments