Setting Up Development Environment for CS520

This guide is for setting up a development environment for CS520 under Windows 2K/XP/Vista. All the software are available online for free. You may also get all the software and the screen capture videos from the MSDNAA software computer in the CS department office. The files are in the CS520 Software folder on the Windows Desktop. The total size of the files is about 360MB. You need to bring with you a flash drive or a writable CD.

1. JDK and Tomcat

Download and install the latest JDK from Sun Microsystems - we only need the Java SE Development Kit (JDK), not Java EE or NetBeans. Set a JAVA_HOME environment variable to the directory where JDK is installed.

Download the latest Tomcat binary release from the Apache Project. Note that there are several packages available for download. You should download the ZIP file under the "Core" distribution. After downloading the file, unzip it to a local directory, e.g. c:\apache-tomcat-6.0.x. Also download the PostgreSQL JDBC driver (postgresql-<version_number>.jdbc4.jar) from PostgreSQL.org, and place it under the lib folder of the Tomcat directory, e.g. c:\apache-tomcat-6.0.x\lib.

2. PostgreSQL

Download the binary release of the PostgreSQL 8.3 database server from PostgreSQL.org. There are two packages to choose from: One Click Installer and pgInstaller. I recommend pgInstaller because One-Click Installer does not run on some versions of Windows (e.g. Windows XP SP3). 

After the package is downloaded, unzip it and run SETUP.bat. Follow the installation wizard:

It is recommended that you do not use the PostgreSQL superuser account postgres to perform day-to-day database operations, so create another user and a database with the same name as the user.

3. Eclipse

Download Eclipse IDE for Java EE Developers from Eclipse.org. Unzip it to a local directory, e.g. c:\eclipse, then start up Eclipse by double-click on eclipse.exe under the Eclipse folder. If you are using Eclipse for the first time, you will be asked to choose a folder to be Eclipse's workspace. Eclipse will store all your projects in that folder.

After Eclipse is started, install the Subclipse plugin as follows:

You should also install the Logfile Viewer plugin. The update site for the plugin does not seem to work any more, so you need to download it from SourceForge then unzip the content to a local directory, e.g. c:\logfile-viewer. The installation procedure is similar to installing Subclipse, except that

4. CSNS

In Eclipse, open SVN Repository Exploring perspective and enter the repository location svn://cs3.calstatela.edu/cs520/<quarter>/<username>, e.g. svn://cs3.calstatela.edu/cs520/f09/cs520stu31. Expand the repository location, right click the trunk folder, select Checkout, then Finish.

The New Project Wizard consists of several steps:

Note that for security reasons, the campus wireless network blocks the port used by Subversion, so if you try to access the repository on campus from your laptop, you have to connect your laptop to the wired network. Networks outside the campus should work just fine.

After the project is checked out, create a PostgreSQL database for CSNS, then use the following two SQL scripts under the db folder of the project to populate the database:

Copy build.properties.sample to build.properties, and modify build.properties according to your setup.

Create an Ant Builder for the project by right clicking on the project, then select Properties -> Builders -> New -> Ant Builder. In the Builder Properties window,

There are two things you need to be careful when creating the Ant builder. First, after setting the target for Auto Build, click the OK button, not the Apply button. Probably due to some bug, clicking the Apply button will undo the target setting instead of applying the setting. Second, after the Ant builder is created, refresh the project by right click on the project then select Refresh. Refreshing the project is important because Ant is an "external tool" to Eclipse, which means that Eclipse is not aware of the changes made by Ant until the project is refreshed.

Finally, right click on the project, then Run As -> Run on Server to run the project. If you can log into CSNS using one of the test accounts, the project is properly set up and you can start working on the code.

Screen Capture Videos

You may want to check out the following screen capture videos that demonstrate the installation processes: