reset password

Setting Up Development Environment for CS520

This guide is for setting up a development environment for CS520 under Windows XP/Vista/7. A screen capture video illustrating this process is available here.

PostgreSQL, Java and Tomcat

Install PostgreSQL as described in PostgreSQL Database Server Installation.

Download and install the latest Java SE JDK from Sun/Oracle - we only need the JDK, not JavaFX, NetBeans or Java EE. Set a JAVA_HOME environment variable to the directory where JDK is installed.

Download the latest Tomcat 7 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-7.0.x.

Eclipse and Eclipse Plugins

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.

In Eclipse, install the Subclipse plugin as follows:

  • Click Help -> Install New Software....
  • Click the Add... button:
    • Name: Subclipse
    • Location: http://subclipse.tigris.org/update_1.6.x
  • For 32-bit Windows users, select only the components that are marked as required. For 64-bit Windows users, select the following components instead:
    • Subclipse (Required)
    • Subversion Client Adapter (Required)
    • SVNKit Client Adapter (Not Required)
    • SVNKit Library
    • JNA Library
  • Complete the installation process.

Follow the same procedure to install the Log Viewer plugin:

  • The update site for the plugin:
    • Name: Log Viewer
    • Location: http://svn.codespot.com/a/eclipselabs.org/logviewer/trunk/de.anbos.eclipse.logviewer.update/
  • Select Log Viewer Feature (i.e. the one with the higher version number) to install.

And the TestNG plugin:

  • The update site for the plugin:
    • Name: TestNG
    • Location: http://beust.com/eclipse
  • Select TestNG to install.

And the m2eclipse plugin:

  • The update site for the plugin:
    • Name: m2eclipse
    • Location: http://download.eclipse.org/technology/m2e/releases
  • Select Maven Integration for Eclipse to install.

And two more plugins which can be installed from m2e Marketplace:

  • Click Window -> Preferences -> Maven -> Discovery -> Open Catalog
  • Select m2e-wtp and m2e-subclipse then click Finish.
  • Complete the installation process.

CSNS2

In Eclipse's New Project wizard, select Maven -> Checkout Maven Projects from SCM. In the next screen, select svn from the dropdown list, then enter the URL svn://cs3.calstatela.edu/cs520/<quarter>/<username>/csns2/trunk, e.g. svn://cs3.calstatela.edu/cs520/f11/cs520stu31/csns2/trunk, then click Finish. CSNS2 uses Maven to build the project. When you set up CSNS2 for the first time, Maven will download the libraries the project depends on over the internet, and this process may take quite a while, so be patient. You may monitor the process in Eclipse's Progress view.

After CSNS2 is checked out and the dependencies downloaded, copy build.properties.sample to build.properties, and modify build.properties according to your setup. Right click on the project then select Maven -> Update Project Configuration... -> OK.

To test CSNS2, create a PostgreSQL database csns2, then use the following three SQL scripts under the src/main/scripts folder of the project to populate the database:

  • csns-create.sql will create the database tables, indexes, functions, and triggers.
  • csns-insert.sql will insert the essential data required by the system, including an administrator account cysun.
  • csns-test-insert.sql will add to the database some test data, including two student accounts jdoe1 and jdoe2.

Create another database csns2test and leave it empty. This database is used for automated testing.

Run the project in Eclipse. If you can log into CSNS using one of the three existing accounts (the passwords are all abcd), the project is properly set up and you can start working on the code.

This page has been viewed 45134 times.