Projects

Project Development

As long as your projects compile and run on the GL severrs (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. The current version of Eclipse is called Indigo. Note that Eclipse requires that you have installed the Java Runtime Environment (JRE) on your PC. The current version of Java is Java 6 JRE which is recommended and can be downloaded from Sun Microsystems.

Program Compilation

The UMBC UNIX system runs 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 program. 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 the directory /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:

alias javac /usr/local/bin/javac

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):

which javac

The response should be /usr/local/bin/javac.

You must add the following to your .cshrc file:

setenv JAVA_HOME /usr/local/jdk1.6.0

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, recommended).

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:

ant
ant compile

To remove class files and backup files (those ending in ~), use this command line:

ant clean

To execute your program, use this command line:

ant run
If your program uses command line arguments, use the -Dargs switch with the command line arguments in quotes separated by whitespace. For example
ant -Dargs="arg1 arg2 arg3" run

To create javadoc for your project, use this command line:

ant doc

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.

Standards and Style

All projects should adhere to the Java coding standards found in the course coding standards document 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.


The Projects:

Project 0
Description — CVS and Ant

Project 1
Description — ChunkLists

Project 2
Description — Binary Search Trees and Recusion

Project 3
Description — Huffman Coding

Project 4
Description — Tic-Tac-Toe