Create .jar of an eclipse project that uses Sqlite DB

寵の児 提交于 2019-12-24 00:44:40

问题


I am having problems creating the .jar for my project. 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.

Since I don't know very much about .jars, here I list some of the suspicious things that may be the problem:

  • The projects uses a sqlite db; there is a db folder inside the project which contains it "/Project/db/adsiDB.sqlite"

  • The .jar for the Sqlite jdbc is added as an external jar in the java build project

  • The .jar for the Sqlite jdbc is in the main folder of the project ( /Project/sqlitejdbc-v056 )

  • When I export the project via eclipse, the .jar is exported to the desktop, and that's it. It doesn't create a folder with the .jar and other files, it's just the .jar and it seems rare to me.

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.


回答1:


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. I imagine that you must have the sqlite driver in your project so you should export with all libraries.

At the exporting choice it's better to select runnable jar files.




回答2:


Try running the jar file on your desktop with:

java -jar yourjarfilename.jar


来源:https://stackoverflow.com/questions/5927001/create-jar-of-an-eclipse-project-that-uses-sqlite-db

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