Installing mysql-connector-java-8.0.15-1.el6.noarch.rpm (available here ) shows libgcj package as a dependency. Installing libgcj creates below file:


$/usr/bin/gij -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-23)

So, is the MySQL java connector still using Java 1.5 ?
OS: CentOS 6.9

  • The gcj project is no longer maintained by GNU, so I suspect that the package is simply outdated (it does say it's from 2012). Do you have any other Java packages installed on the system? Perhaps the dependency can also be satisfied by a more modern variant such as OpenJDK 8. – Haxiel Mar 29 at 6:36
  • I have jdk1.8 Installed in my system(not via yum, but from tar file). I believe dependency tree is libgcj --> java-1.5.0-gcj --> mysql-connector-java. But I am not clear how can we specify mysql-connector to use a specific Java. – penguin Mar 29 at 6:47
  • As far as I know, yum will not be able to deal with that installation (since it came from a tar file, which yum has no knowledge of). But if you open up the mysql-connector RPM, you'll see that it's just a single JAR file (and some documentation). Perhaps you can take that JAR file and add it to the JDK's lib directory? That should make it available to all the applications that start off that JDK. – Haxiel Mar 29 at 6:53
  • Update: It looks like although mysql-connector-java RPM contains only a single jar files, it is getting copied to location /usr/share/java created by libgcj package and this location has many other jar files, probably a dependency for mysql-connector. – penguin Mar 31 at 13:04
  • If you insist on using the system level libraries, then its probably better to install the openjdk package using yum. Once that's done, your dependencies should resolve as intended. – Haxiel Apr 1 at 6:23

I'm able to reproduce this issue with a CentOS 6.9 Docker image. I downloaded the current version of the MySQL Java Connector (8.0.15) from the MySQL site, and tried to install it using yum:

yum localinstall ./mysql-connector-java-8.0.15-1.el6.noarch.rpm

yum gave me this message during the dependency resolution process:

Package mysql-connector-java is obsoleted by mysql-connector-java, trying to install 1:mysql-connector-java-5.1.17-6.el6.noarch instead

The 5.1.17 driver comes from the CentOS 6 'Base' repo. The problem here is that this version of the driver is from July 2011. The predominant version of Java at this time appears to be Java 6, with Java 7 being released in the same month.

The current version of CentOS, CentOS 7, holds the 5.1.25 version of the driver as part of the 'Base' repo. This version of the driver was released in April 2013.

Since the packaged version of the drivers are several years old, it would be preferable to download the platform-independent distribution of the driver and configure it manually.

This is available from Download Connector/J page, under the 'Platform Independent' option. The process to install the driver and configure it is available in the documentation. Briefly, it involves extracting the TGZ/ZIP file to a known location and setting up the CLASSPATH variable so that the JDK/JRE on the system can find the driver.

  • Will try this out. – penguin Apr 5 at 5:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.