jdbc driver not found when execute from exported Jar

会有一股神秘感。 提交于 2019-12-04 17:17:27

Use Fat Jar to build runnable JARs that contain all dependent libs

Mark Rotteveel

You are most likely missing the files from the META-INF folder of the Jaybird jar file. These files are required for Jaybird to work. Another possibility is that you are missing one of the required dependencies of Jaybird (connector-api-1.5.jar, for Jaybird 2.2 or mini-j2ee.jar for earlier versions).

Even if you get this to work though, you will most likely experience an error later on, as Jaybird wasn't developed with support for applets in mind, see http://tracker.firebirdsql.org/browse/JDBC-254 and NoClassDefFoundError with jdbc applet

BTW: Why don't you just use the jar as is. IMHO creating fat jars including all your dependencies is ugly and inflexible.

I finally get the answer, I had to sign the jaybird jar also because that jar was doing read/write operation in HDD

By using Eclipse you can simply solve the problem. By going to Eclipse -> File -> Export -> Runnable JAR file and selecting Extract required libraries into generated JAR option, Eclipse will extract required libraries beside your project and creates the required MANIFEST.MF file for you and then will pack them all together in your JAR file.

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