So.. this is driving me nuts. Day 2 of trying to get mysql working on Java and it's still not working.
I'm developing a Java application on Windows using IntelliJ IDEA (latest version), exporting it as JAR (Build artifact) and running it on a Ubuntu server.
Choosing Run in IDEA (Windows) causes the library (mysql-connector-java-5.0.8) to be included, as the program cannot find the database. However, when I upload the JAR (artifact), I'm getting:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
I've tried just about anything, and after spending almost 16 hours on this, I'm out of options and getting really frustrated. I've read most of the posts here and tried all of them, none of them worked.
Looking at the size of the JAR, the library is being included; just not recognized by Ubuntu. Perhaps I need to use some kind of command-parameter to enable the library? Here's how I run the JAR:
java -jar output.jar
Thanks in advance!