I recently had to setup an Ubuntu 14.04 server with Java and the MySQL JDBC connector. Here’s the steps I took…
Add this PPA in Ubuntu to be able to install Java Oracle 7
sudo apt-get install python-software-properties sudo add-apt-repository ppa:webupd8team/java sudo apt-get update
Install Java Oracle 7
sudo apt-get install oracle-java7-installer (You can add the
-set-default flag to set this version of Java as default).
JAVA_HOME Java Home environment variable by editing the
sudo vi /etc/environment
Add the following
sudo apt-get install libmysql-java
Copy (or symlink) MySQL JDBC Connector driver (.jar) to your Java installation Extentions directory
cp /path/to/mysql-connector-java-version-number.jar /path/to/java/extension/directory/
I found the MySQL connector driver at
/usr/share/java/... and I copied it to
/usr/lib/jvm/java-7-oracle/jre/lib/ext But this may be different for you!
Hopefully everything went well and you got the connector to work. Enjoy!