databases/mysql-connector-java: Looks broken to me

Matthew Seaman matthew at
Mon Apr 6 10:31:24 UTC 2015

On 01/04/2015 17:52, Matthew Seaman wrote:
> On 04/01/15 15:31, Beeblebrox via freebsd-ports wrote:
>> I was getting indications that mysql connections through the com.mysql.jdbc driver was not working. So I searched for a test method (included below) and here are the results.
>> * Server: mariadb100--10.0.17, jailed, tcp connection. Able to connect through other drivers & using same params.
>> * Client: mysql-connector-java-5.1.35
>> * Test code compiled with javac, $ java -cp . jdbc >
>> com.mysql.jdbc.Driver
>> Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver  # I compile with OPTIONS_UNSET= NLS
>> 	at$
>> 	at$
>> 	at Method)
>> 	at
>> 	at java.lang.ClassLoader.loadClass(
>> 	at sun.misc.Launcher$AppClassLoader.loadClass(
>> 	at java.lang.ClassLoader.loadClass(
>> 	at java.lang.Class.forName0(Native Method)
>> 	at java.lang.Class.forName(
>> 	at jdbc.main(
> Thank you for the report.  Unfortunately, I'm at a loss to fix this. The
> driver is supplied pre-compiled by Oracle -- we used to compile it, long
> ago, but then it grew some compatibility shims that meant bits of it
> needed compiling with different JDKs, something that couldn't be
> supported in the ports.  I guess it's time to try recompiling it
> ourselves since java has moved on quite a lot since those days.  Give me
> a while to test that please.
> Given that it's basically a .jar file downloaded from the net and copied
> into position, the OPTIONS_USET=NLS thing will have absolutely no effect
> on mysql-connector-java itself

Having managed to find time to test this out, the situation is still the
same: compiling this .jar requires a java-1.5 JDK to be installed
alongside a more current JDK:

> lucid-nonsense:/tmp/mysql-connector-java-5.1.35:% ant compile
> Buildfile: /tmp/mysql-connector-java-5.1.35/build.xml
> -jdk5-check:
>      [exec] Execute failed: Cannot run program "/usr/lib/jvm/jdk1.5/bin/java": error=2, No such file or directory
> /tmp/mysql-connector-java-5.1.35/build.xml:240: Java 5 is required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk5'. Default: '/usr/lib/jvm/jdk1.5'). Java 6 (for JDBC4+ implementation) is also required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk6'. Default: '/usr/lib/jvm/jdk1.6'.
> Total time: 1 second

Given there is no longer any support in the ports for java-1.5 I'm
afraid we're stuck with using the pre-compiled .jar file.



Dr Matthew J Seaman MA, D.Phil.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 971 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-ports mailing list