创建包含 MySQL 数据库的 JAR 文件

huangapple go评论65阅读模式
英文:

creating jar file with mysql database

问题

我用Java和MySQL数据库创建了一个应用程序,最后当我尝试使用NetBeans将其转换为JAR文件时,它成功转换了,但没有将MySQL连接器提取到lib文件夹中,只提取了应用程序,所以当我尝试从JAR文件中打开它时,我收到以下错误消息:

com.mysql.cj.jdbc.Driver

我该如何解决这个问题?

注意:这是我第一次遇到这个错误,我最近更新了Java版本到Java 9。

英文:

I've created an application with java and mysql database, finally when I try to convert it to jar file with netbeans, it converted but not extract mysql connector with it in lib Folder, extract application only so when I try to open it from jar file I get this error message

com.mysql.cj.jdbc.Driver

how can I resolve that
Note : It's the first time to get this error , I recently update java version to java 9

答案1

得分: 0

尝试将您的Java更新到JDK11版本,因为版本9存在编译问题。您可以查看评论。

如果您使用像Eclipse这样的环境,我推荐,导出为可运行的JAR文件,并选择“将所需的库提取到生成的JAR文件中”。

英文:

Try updating you java to version JDK11 as Version 9 had compilation issues. You can check the reviews.

If you use an environment like Eclipse which I recommend, Export to runnable jar and select 'Extract required libraries into generated jar.

huangapple
  • 本文由 发表于 2020年7月23日 00:12:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/63038626.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定