简体   繁体   English

创建使用Sqlite DB的Eclipse项目的.jar

[英]Create .jar of an eclipse project that uses Sqlite DB

I am having problems creating the .jar for my project. 我在为项目创建.jar时遇到问题。 I am able to create the .jar file but then it doesn't run, it doesn't crashes neither, it just doesn't work and I have no idea why. 我能够创建.jar文件,但它不会运行,也不会崩溃,它只是无法工作,我也不知道为什么。

Since I don't know very much about .jars, here I list some of the suspicious things that may be the problem: 由于我对.jars不太了解,因此在这里列出了一些可能是问题的可疑内容:

  • The projects uses a sqlite db; 这些项目使用sqlite db; there is a db folder inside the project which contains it "/Project/db/adsiDB.sqlite" 项目内部有一个db文件夹,其中包含“ /Project/db/adsiDB.sqlite”

  • The .jar for the Sqlite jdbc is added as an external jar in the java build project 将Sqlite jdbc的.jar添加为java构建项目中的外部jar

  • The .jar for the Sqlite jdbc is in the main folder of the project ( /Project/sqlitejdbc-v056 ) Sqlite jdbc的.jar位于项目的主文件夹(/ Project / sqlitejdbc-v056)中

  • When I export the project via eclipse, the .jar is exported to the desktop, and that's it. 当我通过eclipse导出项目时,.jar将导出到桌面,仅此而已。 It doesn't create a folder with the .jar and other files, it's just the .jar and it seems rare to me. 它不会使用.jar和其他文件创建文件夹,而只是.jar,这对我来说似乎很少。

OK, so that's all. 好的,仅此而已。 I don't know if one of this things may be the reason or if there are any other suggestions. 我不知道这是原因之一还是有其他建议。

It's maybe late for this question but what I will say can help others. 这个问题也许来晚了,但是我会说的可以帮助别人。

When you are exporting your project, try to export with ohters library. 导出项目时,请尝试使用ohters库导出。 I imagine that you must have the sqlite driver in your project so you should export with all libraries. 我想您的项目中必须具有sqlite驱动程序,因此您应该与所有库一起导出。

At the exporting choice it's better to select runnable jar files. 在导出选择时,最好选择可运行的jar文件。

尝试使用以下命令在桌面上运行jar文件:

java -jar yourjarfilename.jar

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM