Building hsqldb version 1.7.1 and 1.7.2

From 1.7.2, in most cases you do not need to build hsqldb at all, since the supplied hsqldb.jar file was built with Java 1.3.1 and will run with any JRE.

Building with ANT, from the Apache Jakarta Project

ANT (Another Neat Tool), from the Jakarta project, is used for building hsqldb. The version currently used to test the build script is 1.5.1.

Obtaining ANT

Ant is a part of the Jakarta/Apache Project.

·         Go to the Installing ANT page and follow the dirctions for your platform

Building with ANT

Under the /hsqldb folder, in /build there is an Ant build.xml that builds the hsqldb.jar. (Ant must be already installed). To use it, change to /build then type:

ant

This displays the command line options which include

ant jar

to make the hsqldb.jar

ant clean

to clean up the /classes directory that is created

ant cleanall

to remove the old jar as well

ant javadoc

to build javadoc

ant jarmain

to build a smaller jar for hsqldb that does not contain utilities

ant jartest

to build a larger jar for hsqldb that contains tests

... and more options

ant jarmin

to build a very small jar with no support for servers

   


HSQLDB can be built in any combination of four different sizes and three JRE (Java Runtime Environment) versions. The smallest jar size (hsqldbmin.jar) contains only the standalone database (no servers) and JDBC support and is suitable for embedded applications. The default size (hsqldb.jar) also contains server mode support and the utilities. The largest size (hsqldbtest.jar) includes some test classes as well.

You need the JUnit jar in the /lib directory in order to build and run the test classes.

A Jar file for HSQLDB is provided in the .zip package. This jar contains both the database and the utilities and has been built with JDK 1.3.1. From version 1.7.2, this jar is compatible with all JDK / JRE runtime versions from 1.1.x to 1.4.

The preferred method of rebuilding the jar is with Ant. After installing Ant on your system use the following command from the /build directory: ant The command displays a list of different options for building different sizes of the HSQLDB Jar. The default is built using:

ant jar

The Ant method always builds a jar with the JDK that is used by Ant and specified in the JAVA_HOME environment variable. From version 1.7.2, Use of JDK 1.1.x is not recommended for building the JAR, even for running under JDK 1.1.x -- use JDK 1.3.1 for compatibility with 1.1.x - 1.4.x. Building with JDK 1.4.x will result in a jar that is not backward compatible.

Before building the hsqldbtest.jar package, you should download the junit jar from www.junit.org and put it in the /lib directory, alongside servlet.jar, which is included in the .zip package.

Building with Batch Files

A set of MSDOS batch files is also provided. These produce only the default jar size. The path and classpath variables for the JDK should of course be set before running any of the batch files.

If you are compiling for JDK's other than 1.2.x or 1.3.x, you should use the appropriate switchToJDK11.bat or switchToJDK14.bat to adapt the source files to the target JDK before running the appropriate buildJDK11.bat or buildJDK14.bat JDK and JRE versions.

From version 1.7.2, Use of JDK 1.1.x is not recommended for building the JAR, even for running under JDK 1.1.x. For earlier versions, the JDK used for building the jar should generally be the same series as the target. This is because the java.sql package in each version (1.1.x 1.2.x 1.3.x 1.4.x) has a different set of methods in its public interfaces. Javadoc can be built with Ant and batch files.

Building on UNIX without Ant (hsqldb 1.7.2)

The script buildjar.sh builds a new hsqldb.jar appropriate for your JDK (the one at $JAVA_HOME). The script does not use Ant or Make, but you do need a JDK at $JAVA_HOME.

Just run buildjar.sh and the script will tell you what JRE(s) the resultant jar file is good for. You are not given a choice of what your target JRE is, because, at this time, it is entirely dependent on the version of your JDK.

fredt@users