DODS Java Software

Developers Information



Dependencies

Java 2 Standard Edition (J2SE)

Minimum: Java 1.2
Recommended: Java 1.4.1 or newer. WARNING: Current code will not compile with Java 1.5 or newer!

This software was developed and tested against the 1.4.1 release of the J2SE

JavaCC

Minimum: Optional (Only required if you plan on working on the parsers.)
Recommended: 2.1 or higher.

Javacc takes a grammar file and produces a Java source code file from it. All of these resulting Java source files are checked into the CVS tree, so unless you anticipate working on the grammar files themselves you will not need to get Javacc. Most of the DODS parsers rely on the JavaCC tool to build. The parsers are built from a grammar file with a .jj extension. The grammars contain the rules for both the scanner and the parser (and thus encapsulate both the functionalities of lex and yacc). The Javacc tool appears to be a red headed step child of the Java development community. Originally it was written by someone at Sun Microsystems ( possibly Bill Joy?). Eventually it was farmed off to small company called WebGain. It now appears that WebGain went under in the Dot Com bust and now Sun has it in an Open Source project under the BSD license. I think it survives because it does something important, we can't live without it, and there is nothing else like it out there. If you are going to work on the parsers you should :

  1. Talk to me first: Nathan Potter voice: (541) 737-2293
  2. Read the ANT section below on how to compile the parsers.

Jakarta Tomcat

Minimum: 4.1.18
Recommended: 4.1.27

Note: This code has not been tested against version 5 of Tomcat!

The servlets were developed and tested using Jakarta/Tomcat 4.1.18. In particular, the code was linked against the servlet.jar bundled with this particular version of Tomcat. This is not (to the best of my knowledge) a library that is included with the standard Java distributions.

ANT

Minimum: 1.5.2
Recommended: 1.6 or higher

This software now builds entirely with ANT. If you haven't already got ANT, then go get it: You need it. The build file is in the directory, buildfiles/java-dods.xml. The serious developer will want to read and understand the contents of this file.

Compiling the source: This should be straight forward. Just go to the top level directory and type "ant -f buildfiles/java-dods.xml compile".

Compiling the parsers: First let me point out that unless you are actively involved in parser development for DODS you shouldn't bother with this. The parsers are built using JavaCC, which takes grammar files (.jj) and makes Java code from them. This Java code is checked into the Java-DODS CVS tree and thus does not need to be rebuilt unless the underlying grammar (.jj) files have been changed, which is strongly discouraged unless you are a DODS core programmer. I suggest you turn back now.

Still here? I warned you...

The parsers are still built using the outdated "Make" based production rules. You will have to get a complete copy of the CVS tree for Java-DODS. Once you've got it. Go to the top level directory (Java-DODS) and do a "make distclean" followed by a "make parsers". This should build the parser's Java file from the .jj grammer files. If afterwards the code fails to compile regularily there may be some problem with you using a latest and greatest Java-CC release. Later versions of Java-CC have a modified API that could be incorrectly referenced by our code.

Additional Libraries:

The core software depends on several third part libraries. All of these are included with the distribution, and these (should) be the ones that the code was compiled against for development and testing purposes. It is possibly (in fact likely) that newer versions of these libraries are available from the various development teams that create these products. Replace them at your own risk.

The gnu regexp package, version 1.1.4, available from gnu.org
The gnu getopt package, version 1.0.6, available form gnu.org

Building the code

Building the Java-DODS software should be very simple.

  1. Go get and install the current J2SE and ANT (see above)
  2. If you haven't got it already, get the source code distribution from OPeNDAP.
  3. Unpack the source code distribution (jar -xvf DistributionFileName.jar)
  4. Enter the top level directory .
  5. Run the command "ant -f buildfiles/java-dods.xml compile"

This will compile all of the distributed software, but nothing more. Each sub project in Java-DODS has it's own build file with targets that are unique to it. For more detailed information you should read (and try to understand) the ANT files in the buildfiles directory. For those of you using an IDE you will have to follow your own "path" to get this going.