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. Although MySQL Connector/J can be be
used with older JDKs, compiling it from source requires at
least JDK 1.4.2. To build Connector/J 5.1 requires JDK 1.6.x
and an older JDK such as JDK 1.5.x;
JAVA_HOME environment variable
at the older installation.
The Ant Contrib and Junit libraries.
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:connectorji
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 installed and an older JDK such as JDK 1.5.x. This is
because Connector/J supports both JDBC 3.0 (which was prior
to JDK 1.6.x) and JDBC 4.0. Set your
JAVA_HOME environment variable to the
path of the older JDK installation.
Place the required extra libraries,
junit.jar, in a separate
directory—for example, "C:\connectorj-extralibs".
Change your current working directory to either the
directory, depending on which branch you intend to build.
To build Connector/J 5.1, edit the
build.xml to reflect the locations of
your JDK 1.6.x installation and the extra libraries. The
lines to change are:
<property name="com.mysql.jdbc.java6.javac" value="C:\jvms\jdk1.6.0\bin\javac.exe" /> <property name="com.mysql.jdbc.java6.rtjar" value="C:\jvms\jdk1.6.0\jre\lib\rt.jar" /> <property name="com.mysql.jdbc.extra.libs" value="C:\connectorj-extralibs" />
Alternatively, you can set the value of these property names
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 ones that will 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 a binary
.jar file that you download from MySQL,
by following the instructions 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
Copyright © 1998, 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices