When you're ready to submit your project, you will upload one JAR file containing everything in your project. To create an archive JAR file from multiple files, you need to use the jar utility. The file generated by the jar archiving tool is based on the ZIP and ZLIB compression formats. The following is a common example of the jar tool creating a file named certificationJarFile that contains all the class files in the current directory: jar cf certificationJarFile.jar *.class Sun's instructions tell you what to name the JAR file, so use that name , not the one you see in these examples; you lose points if you use a different filename. For my solution, I used the following command ( my.jar was the JAR filename I was given in Sun's instructions): jar cfv my.jar * If you issue this command from your project's root directory, assuming it is the same one shown previously, all the class files in the application package are added, including the server , client , and database directories. This command also adds all the source directories, which mimic the class directories, and grabs all the javadoc files and loose files in the root directory.
These are the most common options for the jar tool:
Some people nest JAR files and even use executable JAR files. Both approaches are fine. I chose to make it simple for the evaluator by not nesting JAR files, not using executable JARs, and placing the README.TXT and design decisions files in the root directory. Introducing points of possible failure in this structure isn't desirable, so keep it as simple and reliable as possible. You get no additional points for complexity. |