"jar": It is a command line tool for managing JAR files. This tool is distributed as part of the Oracle ( Formerly SUN ) JDK package
You can package your classes in a jar file and that Jar file can be used in class path, also you can use jar commands to view the files of jar and extract the jar itself.
Lets see how we can use the jar command :
1. To create new jar file :
jar cf [jar-file] [input- files]
2. Extract the jar file :
jar xf jar-file
3. Run the jar file :
java -jar application.jar
Note: Assuming manifest file present in jar.
4. Extract the jar file :
jar tf jar-file
- Blogger Comment
- Facebook Comment