Com.mysql.jdbc.Driver not found in Runnable jar

I have implemented a simple Swing application that creates a database and added mysql-connector-java-5.1.18-bin.jar to the build path of my projects. it works great when i run Eclipse as a project. But I exported this project to jar executable, it doesn't work.

I am writing code to print exceptions to a file. It gives the following line: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I have already added the required jars for my project. I can't figure out why it doesn't work?

+3


source to share


1 answer


It seems that your JAR does not have the required libraries.



You need to export your application using the option Package required libraries into generated JAR

.

+3


source







All Articles