Apache Derby: Source Code
Intended Audience
This page provides information for developers on how to check out and build the Derby source code. The official Derby releases are available on the Downloads page.
Derby source code
Derby source is stored in the Subversion (SVN) repository at Apache. For Derby web site source, see the Apache Derby Web Site page. The rest of this section describes where to get the Derby source code.
First, download and install Subversion from http://subversion.tigris.org/
Branches
Currently Derby has the following branches:
- 10.4
- 10.3
- 10.2
- 10.1
- 10.0
Use the command shown below to check out the source code for a branch:
svn co https://svn.apache.org/repos/asf/db/derby/code/branches/branch/
Where branch is the number of the branch. For example, the following command checks out the source code for the 10.2 branch:
svn co https://svn.apache.org/repos/asf/db/derby/code/branches/10.2/
Development trunk
Use the command shown below to check out the development trunk:
svn checkout https://svn.apache.org/repos/asf/db/derby/code/trunk/
Production use of Derby should use official Derby releases or snapshot builds off the branches (or self built jars off the branches with bug fixes).
The development trunk (http://svn.apache.org/repos/asf/db/derby/code/trunk) is a development code line, which supports:
- Development of new features.
- Early access to new features for testing.
The development trunk is not suitable for production use because:
- It contains new features that have only undergone limited testing and that may corrupt data and/or return incorrect results.
- It may create on-disk database formats that are not upgradable to future releases of Derby. Databases created by official Derby releases will be upgradable to future versions.
Software required to build Derby
Derby is designed to work in JSR 169, JDBC 3.0, and JDBC 4.0 environments. In addition, optional run-time code may take advantage of features introduced by Java 5. For this reason both JDK1.4 and Java 5 are required for the build environment. The build is set up so that most of the code is compiled against JDK 1.4 libraries so that there are no dependencies on classes from higher levels of Java. A significant exception to this is the JDBC 4.0 code.
The software required to build the Derby mainline is summarized in the table below. However, doublecheck the BUILDING.txt instructions for installation locations before downloading the software. If you need to build an earlier version of Derby, please consult the BUILDING.txt in the appropriate code branch. As of this writing, and with the exception of the JDKs and Ant, the Derby build procedure expects most software to be installed in ${derby.source}/tools/java (where ${derby.source} is the root location of the Derby source on your system).
| Software | Where to obtain it |
|---|---|
| Apache Ant 1.6.x | http://ant.apache.org/bindownload.cgi |
| Java Development Kit (JDK) release 5 | Any Java 5 JDK, Java's reference implementation is at http://java.sun.com/j2se/ |
| Java Development Kit (JDK) release 1.4.x | Any JDK 1.4.x, Java's reference implementation is at http://java.sun.com/j2se/ |
| Java Development Kit (JDK) release 6 (optional) | Any Java 6 JDK, Java's reference implementation is at http://java.sun.com/j2se/ |
How to build Derby
Instructions for building Derby are in a file named BUILDING.txt at the root of the source code tree.
The previous link points to the BUILDING.TXT file in the development trunk. If you want to access the BUILDING.TXT file for a specific branch, access the file directly by checking out the branch or the development trunk.
How to test Derby
Instructions for testing Derby are in the source code tree in java/testing/README.htm. (Note: if your browser shows HTML source for this page instead of displaying it, save the file locally with File -> Save Page As, then open the file you saved.)
The previous link points to java/testing/README.htm in the development trunk. If you want to access the instructions in a specific branch, access the file directly by checking out the branch or the development trunk.
Also, see the tests page for test results resources.
How to submit a patch
See the Contribute Code or Documentation section in the Get Involved! page.
Last updated: October 16, 2007

