Jar
- Pack edu folder into P.jar, Pack CarUse.class into C.jar
Create Jar
- jar cvf jarFile inputFile, create a jar file
- jar tvf jarFile, view a jar file
- jar xf jarFile, extract a jar file
- jar xf jarFile archivedFile, extract a specific file from a jar file
- jar uf jarFile inputFile, add a file into a jar file
Manifest File
- Create the manifest file
- jar cfm jarFile manifest-additon inputFiles, add the content of inputFile into the manifest
- Add Main-Class: edu.ecsu.cs.Car in Manifest.txt
- jar cfm P.jar Manifest.txt edu, create jar file
- Add entry point with jar tool
- jar cfe jarFile className inputFiles
- jar cef P.jar edu.ecsu.cs.Car edu
- Implement with jar file
- java -jar P.jar, implement main function in Car
- Reference class in a jar file from other jar files
- Add Class-Path: P.jar in Manifest.txt
- Add Main-Path: CarUse in Manifest.txt
- jar cfm C.jar Manifest.txt CarUse.class, create jar file
- java -jar C.jar, implement CarUse in C.jar by referecing classes in P.jar
- Version Information
- Name
- Specification-Title
- Specification-Version
- Specification-Vendor
- Implementation-Title
- Implementation-Version
- Implementation-Vendor
Reference