Projects

Compiling Projects

The UMBC UNIX systems run two different versions of UNIX. The systems known as linuxl.gl.umbc.edu and linux2.gl.umbc.edu run the version of UNIX called Linux. The system known as solaris.gl.umbc.edu runs the version of UNIX called Solaris. The TAs will use either linux1 or linux2 to compile and test your projects. Therefore, ALL PROJECTS must compile and execute on linux1 and linux2. In theory, the java slogan of "write once, run anywhere" will apply, but where project grades are involved the more appropriate slogan is "better safe than sorry".

The TAs will use the java compiler in /usr/local/bin, so students should use that compiler as well to ensure that their code will compile for the TAs. To avoid problems with using the wrong java compiler (there may be multiple versions of javac on the gl machines and which one gets run depends various environment variables and settings), you should modify your .cshrc file (found in your home directory -- note the leading dot) by creating an alias for javac. Add the following line near the bottom of your file: To check that you are using the correct compiler, execute the following command (remember to log out and log back in after changing your .cshrc so that the change takes effect): The response should be /usr/local/bin/javac.

If you develop your projects on your own PC, be sure that you are using Java 5 (version 1.5.x) or Java 6 (version 1.6.x).

Using Ant

Ant is a tool for compiling large Java-based projects. Ant is to Java as make is to C and C++, but ant was written specifically with Java in mind, and was designed to overcome some of the problems of make. The scripts that compile and execute your projects will use ant, so you must be sure that your code can be compiled using ant as well. The version of ant in /usr/local/bin will be used by the scripts.

When you check out your project directory using CVS, it will contain a file named build.xml. This file tells ant how to, among other things, compile your code, and is similar to the Makefile used by make. We anticipate that this build file will work without modification for all students and all projects. With build.xml in the root directory of your project tree, you can compile all of your source files using either of the following command lines:

To remove class files and backup files (those ending in ~), use this command line: To create javadoc for your project, use this command line: A directory named doc will be created in the directory containing build.xml, and you can browse your javadoc by opening index.html in the doc directory.

If you need to modify the supplied build.xml for a project, feel free. For example, you may want to add file types that get removed when running "ant clean". Check out the ant manual. If you do modify build.xml, be sure to check it in using CVS, and the default target (i.e., the one built when ant is run with no command line arguments) must compile your code, and there must be a target named doc that creates javadoc in a directory named doc below the directory containing build.xml.

Typically, you will run ant when your current working directory is the one containing build.xml. However, you can also run ant from any directory beneath that one using the "-find build.xml" option. For example:

This causes ant to look for build.xml in the current directory and, if such a file is not found, to look for build.xml in the parent directory, the parent's parent, and so on. If you want this behavior to be the default, set the value of the ANT_ARGS environment variable to be "-find build.xml" and you won't have to supply that option on the command line.

Project Development

As long as your projects compile and run on linux1 or linux2 using the Java and ant versions in /usr/local/bin, you are free to use whatever development tools you want. However, we recommend that you use the Eclipse Integrated Development Environment (IDE), which is widely used in industry. Eclipse is designed to assist you when writing Java applications. Eclipse is available on the PCs located in the OIT labs. If you prefer to work on your own PC, the "Eclipse IDE for Java Developers" may be downloaded free of charge from www.eclipse.org. Note that Eclipse requires that you have installed the Java Runtime Environment (JRE) on your PC. Java 5 JRE is recommended and can be downloaded from Sun Microsystems.

Standards and Style

All projects should adhere to the CMSC 202 Coding Standards, unless otherwise directed. Each project will be evaluated on these guidelines. Failure to follow these criteria will result in a lower project score.

Project Submission and Policies

Projects will be submitted for grading using the open source CVS version control system, which is widely used in industry. All projects will be submitted as .java files. Java requires that each class be found in its own .java file. The file which contains main( ) must be named for the project. For example, for Project 1, main( ) would be found in Proj1.java. Course policies on grading, cheating, and due dates can be found in the 341 Project Policy.


The Projects:

Project 0
Description -- testing submit

Project 1
Description -- a text-based adventure game, dusting off your Java coding skills

Project 2
Description -- maze path finding using stacks and queues

Project 3
Description -- a trie-based cheat checker

Project 4
Description -- hashing for improved tic-tac-toe play

Project 5
Description -- Huffman coding for compression