Read this section only if you are interested in helping us test our new code. To just get MySQL Connector/J up and running on your system, use a standard binary release distribution.
To install MySQL Connector/J from the development source tree, make sure that you have the following software on your system:
A Bazaar client, to check out the sources from our Launchpad repository (available from http://bazaar-vcs.org/).
Apache Ant version 1.7 or newer (available from http://ant.apache.org/).
JDK 1.4.2 or later for building Connector/J 5.0 or earlier, JDK 1.6.x AND JDK 1.5.x for building Connector/J 5.1. Refer to Section 2.2, “Java Versions Supported” for the version of Java you need to build or run any Connector/J release.
The Ant Contrib (version 1.03b is available from http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/) and Junit (available from https://github.com/junit-team/junit/wiki/Download-and-Install) libraries.
jar files from the
Hibernate ORM 4.1.12 Final release bundle, which is
To check out and compile a specific branch of MySQL Connector/J, follow these steps:
Check out the latest code from the branch that you want with one of the following commands.
The source code repository for MySQL Connector/J is located on Launchpad at https://code.launchpad.net/connectorj. To check out the latest development branch, use:
bzr branch lp:connectorj
This creates a
in the current directory that contains the latest sources
for the requested branch.
To check out the latest 5.1 code, use:
bzr branch lp:connectorj/5.1
This creates a
5.1 subdirectory in the
current directory containing the latest 5.1 code.
To build Connector/J 5.1, make sure that you have both JDK
1.6.x AND JDK 1.5.x installed. You need
both JDKs because Connector/J 5.1 supports both JDBC 3.0
(which has existed prior to JDK 1.6.x) and JDBC 4.0. Set
JAVA_HOME environment variable to
the path to the JDK 1.5.x installation.
Place the required
(in exactly that name, without the version number in it;
jar file if needed) and
junit.jar file in a separate
In the same directory for extra libraries described in the
last step, create a directory named
hibernate4, and put under it all the
jar files you can find under the
/lib/required/ folder in the Hibernate
ORM 4.1.2 Final release bundle.
Change your current working directory to either the
directory, depending on which branch you intend to build.
In the directory, create a file named
build.properties to indicate to Ant the
locations of the Javac and
your JDK 1.6.x, as well as the location of the extra
libraries. The file should contain the following property
settings, with the “path_to_” parts replaced by
the appropriate filepaths:
Alternatively, you can set the values of those properties
through the Ant
Issue the following command to compile the driver and create
.jar file suitable for installation:
This creates a
build directory in the
current directory, where all build output will go. A
directory is created in the
directory that includes the version number of the sources
you are building from. This directory contains the sources,
.class files, and a
.jar file suitable for deployment. For
other possible targets, including those that create a fully
packaged distribution, issue the following command:
A newly created
.jar file containing
the JDBC driver will be placed in the directory
Install the newly created JDBC driver as you would install a
.jar file you download from
MySQL by following the instructions given in
Section 3.2, “Installing the Driver and Configuring the
A package containing both the binary and source code for Connector/J 5.1 can also be found at the following location: Connector/J 5.1 Download