I have a simple JDBC project that fetches data from a database. I have used mysql-connector-java-5.1.12.jar
for jdbc connection.
Now I want to create an executable jar of my project from command line (not from eclipse).
I tried using :
jar cfe myJar.jar com/demo/MySqlJDBC com/demo/MySqlJDBC.class
The jar was created, but it doesn't contain mysql-connector jar
and so when I run the jar as:
java -jar myJar.jar
I get error like:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
So, my question is how can I pack the mysql-cnnector-jar
while creating jar of my project without using maven and eclipse (just from command line)