954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

problem related to creating jar file

I have problem with creating jar file want to create jar file with mysql connector
i include the mysql connector in manifest file but still it five me error like:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at serverGUI.checkDB(serverGUI.java:194)
at serverGUI.run(serverGUI.java:115)
at java.lang.Thread.run(Thread.java:595)

pls tel me how to include mysql jar into jar file

Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 19
Solved Threads: 0
 
how to include mysql jar into jar file


I don't think you want another jar inside of your jar.
You want to add the other jar to your classpath.
See the manifest file's Class-Path: record to do this.

If you want all the classes in one jar file, extract the contents of the other jar and put all of those files into your jar as separate files.

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

Thanks!

I dont understand what u mean ...
I want to add mysql connector in my jar file (project jar file).
to connect with database.

Pravinrasal
Junior Poster in Training
54 posts since Jul 2011
Reputation Points: 19
Solved Threads: 0
 

What kind of file is the "mysql connector"?
Where is it located?
Is it in a jar or is it in a folder?

NormR1
Posting Expert
Moderator
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: