Top | Web home | SourceForge home Logo
$Id: //open/dt/dev/saffron/doc/install.html#2 $
(C) Copyright 2002-2003 Disruptive Tech
Author Julian Hyde
Created February 15th, 2002

How to build and install Saffron

1. Contents

  1. Contents
  2. Modification history
  3. Setup build environment
  4. Get the source code
  5. Build
  6. Run the unit tests
  7. Run Walden
  8. Appendix A: Product installation instructions
  9. Appendix B: Coding guidelines
  10. Appendix C: How to
    1. How to debug Tomcat in Intellij

2. Modification history

Date Revision Author Comment
February 15th, 2002 1 Julian Hyde Created
May 29th, 2002 2 Julian Hyde Tomcat
June 11th, 2002 3 Julian Hyde Ant 1.5
January 11th, 2004 4 Julian Hyde Ant 1.6.0, JavaCC-3.2

3. Setup build environment

Here are the steps to setup a build environment.

  1. Install JDK 1.4.2.
  2. Install Ant.
  3. If you want to run the saffron web server, install Tomcat.
  4. Install JUnit.
  5. Install JavaCC.
  6. Modify build.bat, setting JAVACC_HOME, ANT_HOME, JUNIT_HOME, TOMCAT_HOME. (It may be sufficient to just change HOME_DRIVE.) On Linux, edit the bash script named build instead.


  1. Install Jikes.

4. Get the source code

Releases are available from Sourceforge.

Developers should define a client to the Perforce server.

5. Build

As follows:

cd ${project.location}

6. Run the unit tests

To run the JUnit regression test:

build test

The detailed results of the tests are stored in the testlog directory. Tracing (via java.util.logging) is automatically configured. By default, the trace file is trace/SaffronTrace.log. You can change the tracing level and trace file location by editing trace/

Or you can run class saffron.test.Main using any JUnit test harness. You can control the behavior of the test by creating a file called Here is an example:

saffron.class.dir=D:/saffron/classes D:/saffron/classes -d D:/saffron/classes -verbose

You'll need an ODBC datasource called empdept in order to run the JDBC flavor of the tests.

To generate from Sales2.oj and compile it to Sales2.class; and to compile to Test.class:

cd ${project.location}
build compile.examples

(There is a bug in the ojavac Ant task. If you get an IOException, remove and try again.)

To run Sales2:

build run.sales.Sales2

7. Run Walden

Walden is a web application which runs inside Tomcat.

  1. Install Tomcat.
  2. Edit ${project.location}/ and ${project.location}/web/walden/WEB-INF/web.xml for your environment.
  3. Build and deploy walden.war, and start Tomcat:
    build run.walden
  4. Hit http://localhost:8080/walden.

To stop Tomcat cleanly, go to ${tomcat.home}/bin and run shutdown.

Appendix A. Product installation instructions

These are the products I used to build saffron. Install all of the products marked 'required'. (I use /-es in paths because I am running MKS on Windows 2000, and it makes things simpler.)

In the following, the symbol ${project.location} means the root of your source tree.

Where the instructions suggest setting an environment variable, it is often sufficient to edit the corresponding line in ${project.location}/build.bat.

Product Version Comment
JDK 1.3 or later (I use version 1.4.2_03.) Available from I installed the JDK in E:/j2sdk1.4.2_02. Set JAVA_HOME to same, and CLASS_PATH to %JAVA_HOME%/lib/dt.jar.
Ant 1.6.0 or later  I downloaded, extracted to E:/jakarta-ant-1.6.0, and set ANT_HOME to the same.
Tomcat 4.1.24 or later Available from I downloaded, extracted to E:/jakarta-tomcat-4.1.24. Uncomment and set TOMCAT_HOME in build.bat.
Jikes   Available from I downloaded, and extracted jikes.exe to C:/winnt/system32. Then uncomment the relevant lines of ${project.location}/
JUnit 3.8.1 or later Available from I downloaded, extracted to E:/junit3.8.1, and set JUNIT_HOME to the same.
JavaCC (parser generator) javacc-3.2 Available from Install in E:/JavaCC2.1 or similar. Edit ${project.home}/build.bat. Edit ${project.home}/
Intellij IDEA (a Java IDE)   You can download a 30-day evaluation copy from Follow the instructions in Install.txt in


Appendix B: Coding guidelines

Appendix C: How to

C.1. How to debug Tomcat using IntelliJ

  1. add ${tomcat.home}/webapps/walden.war to intellij's classpath
  2. edit ${tomcat.home}/bin/catalina.bat as follows:
    if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
    %_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xnoagent
      -Xrunjdwp:transport=dt_socket,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS%
      -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%"
    goto end
  3. create ${tomcat.home}/bin/setenv.bat as follows:
    set JPDA_ADDRESS=5000
  4. build debug.walden
  5. attach intellij's debugger to port 5000


End $Id: //open/dt/dev/saffron/doc/install.html#2 $