com.mysql.jdbc.Driver what to do?

随声附和 提交于 2019-12-02 08:12:36

add mysql-connector-java-5.1.22-bin.jar to class-path in MANIFEST.MF file in AvatarServer.jar. Example:

Class-Path: mysql-connector-java-5.1.22-bin.jar

-jar and -cp are mutually exclusive. -jar says: the classpath is the following jar, and all the libraries referenced in its manifest file. So you must use:

java -cp mysql-connector-java-5.1.22-bin.jar;AvatarServer.jar com.foo.bar.AvatarMainClass

or, if you want to run your app with -jar, reference the mysql driver jar in the jar's manifest file, as explained in the jar tutorial.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!