IMGD 4000 (D 09)
This page describes the steps required to create and verify your homework jar file in the turnin directory of the chess project.
for Preparing Homework Jar File
The following assumes you have imported chess.zip from the course
myWPI site into Eclipse as a project. If not, then you will need to
familiarize yourself with the
general concept of resource loading and the use of the jar
Don't forget to update your javadoc
(Project>Generate Javadoc) and the toplevel README.txt file in the 'turnin' directory before
creating your jar file to turn in!
Note that the 'turnin' directory already contains an example chess.jar file, which was created from the small Chess example program provided to illustrated loading a model.
- Using the command line (not Eclipse)...
- Make 'turnin' the current working directory (cd).
- Try executing the provided chess.jar file by invoking the "run_chess Chess" (or .sh) command file.
- You should see the base of the black King. Type 's' to move it farther away.
Here are the steps in Eclipse to make a new chess.jar file containing your homework:
- Right click on chess.jardesc and select Open Jar Packager.
- Under "Select the resources to export", check all and only the folders
that are needed for the current homework.
- always leave default package checked
- make sure the 'doc' folder (containing javadoc) is checked
- check the README.txt file if you have added one
- do not check models (to keep jar file conveniently small)
- Make sure that both "Export generated class files and resources" and
"Export Java source files and resources" are checked (the other two options in this list should not be checked).
- Click Finish.
- (If you later edit your code, but have not defined any new packages, and
want to create a new jar file, you can simply select Create Jar instad of
Open Jar Packager.)
Finally, upload the chess.jar you have created to Web Turn-In.
FYI, the jar file thus created will not contain either the distributed chess models or the jME libraries, since the TA will run your code in the same chess project environment. However, if you look at the manifest file for chess.jar (which is generated from chess.mf), you will see the correct classpath references to these shared resources.
Make sure you verify that your jar file is correct using the run_chess command, before uploading it to turn-in!