Building the Java-OPeNDAP software should be very simple.
This will compile all of the distributed software, but nothing more. For more detailed information you should read (and try to understand) the ANT build.xml file. For those of you using an IDE you will have to follow your own "path" to get this going.
If you are trying to fix a parser bug you better read the Parsers section at the bottom of this document.
Java 2 Standard Edition (J2SE)
Minimum: Java 1.5
Recommended: Java 1.6.x
This software was developed and tested against the 1.6.0 release of the J2SE
The core software depends on several third part libraries. All of these are included with the distribution (in the lib directory). 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.
Minimum: 4.1.18
Recommended: 6.0.29
Note: This code has not been tested against version 7 of Tomcat!
The servlets were developed and tested using Tomcat 5.5.20. 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.
Minimum: 1.5.2 (Warning!)
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. There is a master build file in the top level directory which contains all of the various production rules for the software.
Compiling the source: This should be straight forward. Just go to the top level directory and type "ant compile". For more detailed instructions you should read the master build file, build.xml.
Currently the DAP2 parsers are implemented as grammers written in/for YACC, along with some written in/for JavaCC. You don't NEED to be able to compile the parsers in order to build the software. All of the java files that are generated by YACC and JavaCC are checked into the system and unless you have specific needs to alter the parsers (like in order to fix a bug) then I strongly recommend that you just leave them alone. Really.
Here we will describe how to build the parsers whose grammars are written in YACC.
Here is an example of the content of the javacc-config file:
JavaCC.home=/usr/local/javaccOnce you have created the javacc-config then the parsers target in Java-OPeNDAP/buildfiles/opendap.xml should work, at least within the constraints of the Warning.
Warning: There exists a version conflict between some versions of ANT and some versions of JavaCC. If you have JavaCC 2.1 or 2.0 then the parsers should compile fine, no matter what version of ANT you have. However, if you are using JavaCC 3.0 or newer (released after the JavaCC project migrated from WebGain to Java.Net) older versions of ANT will fail to correctly identify the JavaCC libraries. The mail and bug archives indicate that the problem was fixed as of 5/26/2003, but the patch won't migrate into a release until version 1.6. You can grab a nightly build of Ant release 1.6beta as work around until 1.6 hits the street. Good luck.
Minimum: Optional (Only required if you plan on working on the
constraint expression parser.)
Recommended: 2.1 or higher. (Warning!)
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 SVN tree, so unless you anticipate working on the grammar files themselves you will not need to get Javacc. Most of the OPeNDAP parsers rely on the yacc tool to build. The constraint expression parser is built from a grammar file with a .jj extension. The grammar contains the rules for both the scanner and the parser (and thus encapsulate both the functionalities of lex and yacc). If you are going to work on the parsers you should :