I'm packaging my java program as a jar..it includes mysql-connector.jar..it runs fine when i run it in eclipse..now i need to distriute the jar file..I packaged the jar file and when I run it through command line using java -jar myprogram.jar, it throws ClassNotFoundException: com.mysql.jdbc.Driver
could anyone please tell me what is going wrong??

my manifest looks like this

<?xml version="1.0" encoding="UTF-8"?>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    <classpathentry kind="lib" path="lib/mysql-connector-java-5.1.14-bin.jar"/>
    <classpathentry kind="output" path="bin"/>

You just go on your program you want to build as .jar.
Go File>Export>Runnable Jar and then you have options how to pack it...
Find what you want and it will automaticly include jdbc.driver in your .jar package...

This question has already been answered. Start a new discussion instead.