Creating JAR files - 1
14 April 2008This post is all about learning how to create JAR files. After going through this, you will be able to easily create JAR files.
The basic JAR coomand syntax is as follows:
jar cf myjar input-file(s)
Let me explain the command;
- c option indicates that I want to create a JAR file
- f option indicates that I want the output to go to a file rather than to stdout
- myjar is the name that I want the JAR file to have. It can be any name you wish to have.
(Convention is to give JAR file name with the .JAR extension. This is not mandatory)
- input-file(s) argument is a list of one or more files that we want to include in the JAR file. Its space-separated list.
We may use wildcard * symbol in the argument.
- c and f options can appear in either order (without space)
jar cf myjar input-file(s) - CORRECT
jar fc myjar input-file(s) - CORRECT
jar c f myjar input-file(s) - INCORRECT
continued …
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Creating JAR files - 1