Creating a .jar file

You normally should submit all homeworks through CVS, but if you are having difficulty with CVS, we may ask you to email us a .jar file containing your source code.  A .jar file is a single file that contains other files (similar to .zip or .tar files). In order to create a .jar file containing the source code for your project, please follow these steps:

  1. In the Dr. Java perspective, select your project in the "Package Explorer" (upper left pane)
  2. Select File->Export from the pull-down menu
  3. Select "JAR file" from the list of options and press the Next button
  4. Examine the checked items to make sure the files you want included in the .jar file are correct.  You should almost never have to change anything here, but you can check this to have confidence that you are including what you want.  Note that you will have to click on the small "plus" sign just to the left of your project name to see the sub-directories that will be included.  For example, opening the 'hw8' project will show a 'hangman' package that you can then click on to see in the right pane which files will be included from that package.
  5. Make sure the box is unchecked next to "Export generated class files and resources"
  6. Make sure the box is checked next to "Export java source files and resources"
  7. In the text box near the bottom where it says "JAR file", enter the full path to a .jar file that you want to create (i.e., "c:\temp\hw8.jar")
  8. Click the Finish button

The following picture shows a screenshot of the JAR Export dialog just before the Finish button has been pressed:

That's it.  The .jar file you specified has now been created, and you can send it to us via email as an attachment.