Getting Castor set up for use is just as simple as setting up Zeus; after a download and some classpath manipulation, you are ready to go. First, visit the Castor download site at http://castor.exolab.org/download.html, and download the Castor package. As of this writing, the latest version was 0.9.3.9, so the download file was called castor-0.9.3.9.tgz or castor-0.9.3.9.zip. Several other options for downloading are worth mentioning:
The Castor jar files without any tools or examples
For use if you need only XML data binding, without any of Castor’s other mapping features
A complete set of Castor documentation, including relevant specifications; handy for reference purposes
Once you’ve got the archive, you’ll want to expand it into a working directory so you can access the samples and command-line tools. You’ll then need to add the Castor library to your classpath:
C:\dev\castor> set CLASSPATH=%CLASSPTH%;c:\dev\castor\castor-0.9.3.9.jar
Also make sure you have an XML parser in your classpath; I used xerces.jar in these examples. There are several other libraries in the Castor download, but you will not need any of them for XML data binding. However, if you plan to work with Castor’s Java Data Objects (JDO) capabilities (see the end of this chapter for more details), then you will also need to add jdbc-se2.0.jar and jta1.0.1.jar to your classpath.
Additionally, you will want to download ...