Beta Draft: 2017-03-17
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 Git client, to check out the sources from our GitHub repository (available from http://git-scm.com/downloads).
Apache Ant version 1.8.2 or newer (available from http://ant.apache.org/).
JUnit 4.1.2 (available from https://github.com/junit-team/junit/wiki/Download-and-Install).
Javaassist 3.19 or newer (available from http://jboss-javassist.github.io/javassist/).
Protocol Buffers Java API 2.6.0 or newer (available from, for example, the Maven Central Repository).
.jarfiles from the Hibernate ORM 4.1 or 4.2 Final release bundle (available at http://sourceforge.net/projects/hibernate/files/hibernate4/).
To check out and compile MySQL Connector/J, follow these steps:
Check out the code from the source code repository for MySQL Connector/J located on GitHub at https://github.com/mysql/mysql-connector-j. The latest release of the Connector/J 6.0 series is on the
release/6.0branch; use the following command to check it out:
git clone --branch release/6.0 https://github.com/mysql/mysql-connector-j.git
Under the current directory, the commands create a
mysql-connector-jsubdirectory , which contains the code you want.
Make sure that you have JDK 1.8.x installed.
Place the required
protobuf-java-x.y.z.jarfiles in a separate directory—for example,
In the same directory for extra libraries described in the last step, create a directory named
hibernate4, and put under it all the
.jarfiles you can find under the
/lib/required/folder in the Hibernate ORM 4 Final release bundle.
Change your current working directory to the
mysql-connector-jdirectory created in step 1 above.
In the directory, create a file named
build.propertiesto indicate to Ant the locations of the root directories for your JDK 1.8.x installation, 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 a
.jarfile for Connector/J:
This creates a
builddirectory in the current directory, where all the build output goes. A directory is created under the
builddirectory, whose name includes the version number of the release you are building. That directory contains the sources, the compiled
.classfiles, and a
.jarfile for deployment. For more information and other possible targets, including those that create a fully packaged distribution, issue the following command:
Install the newly created
.jarfile for the JDBC driver as you would install a binary
.jarfile you download from MySQL by following the instructions given in Section 4.2, “Installing the Driver and Configuring the
Note that a package containing both the binary and source code for Connector/J 6.0 can also be downloaded from the Connector/J Download page.
Going from Connector/J 5.1 to 6.0, a number of Ant properties for building Connecotr/J have been renamed or removed; see Section 220.127.116.11, “Changes for Build Properties” for details.