简体   繁体   English

在Runnable jar文件中找不到com.mysql.jdbc.Driver

[英]com.mysql.jdbc.Driver not found in Runnable jar file

I have implemented simple Swing application which creates database and added mysql-connector-java-5.1.18-bin.jar to my projects build path. 我已经实现了简单的Swing应用程序,它创建数据库并将mysql-connector-java-5.1.18-bin.jar添加到我的项目构建路径中。 it works fine when I run in Eclipse as a project. 当我在Eclipse中作为项目运行时,它工作正常。 But I exported this project to runnable jar file it doesnt work. 但我将此项目导出到runnable jar文件它不起作用。

I write some code to print exceptions to file. 我写了一些代码来打印文件的异常。 It gives this line : java.lang.ClassNotFoundException : com.mysql.jdbc.Driver 它给出了这一行: java.lang.ClassNotFoundException:com.mysql.jdbc.Driver

I already added required jars to my project. 我已经为我的项目添加了必需的罐子。 I cant understand why it doesnt work ? 我不明白为什么它不起作用?

It seems that your JAR is not having the required libraries. 您的JAR似乎没有所需的库。

You need to export the application using the option Package required libraries into generated JAR . 您需要使用选项Package required libraries into generated JAR将应用程序导出Package required libraries into generated JAR

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 class not found exception com.mysql.jdbc.driver甚至我添加了jar文件 - class not found exception com.mysql.jdbc.driver even I added the jar file java.lang.ClassNotFoundException:Maven可运行jar的com.mysql.jdbc.Driver - java.lang.ClassNotFoundException: com.mysql.jdbc.Driver for Maven runnable jar 找不到类com.mysql.jdbc.Driver - Class not found com.mysql.jdbc.Driver 未找到指定的 JDBC 驱动程序 com.mysql.jdbc.Driver 类 - Specified JDBC Driver com.mysql.jdbc.Driver class not found ClassNotFoundException com.mysql.jdbc.driver jar 来自导出的 jar 文件 - ClassNotFoundException com.mysql.jdbc.driver jar from exported jar file 找不到驱动程序:[com.mysql.jdbc.Driver]播放框架 - Driver not found: [com.mysql.jdbc.Driver] play framework 即使添加了mysql-con.jar文件,“ com.mysql.jdbc.Driver”的ClassNotFound异常 - ClassNotFound Exception for “com.mysql.jdbc.Driver” even after adding mysql-con.jar file ClassNotFoundException:在JAR执行时com.mysql.jdbc.Driver - ClassNotFoundException: com.mysql.jdbc.Driver On JAR Execution jasperreports 上的远程 MYSQL 错误:未找到 com.mysql.jdbc.Driver - Remote MYSQL on jasperreports error: com.mysql.jdbc.Driver not found Eclipse:我已经添加了JAR文件。 java.lang.ClassNotFoundException:com.mysql.jdbc.Driver - Eclipse: I have added the JAR file. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM