How to pack a SQLite database into a jar?

白昼怎懂夜的黑 提交于 2019-12-06 16:44:35

AFAIK you can't modify resources inside a jar without much hassle (basically it is a zip and thus it should be possible, but there might be file locks by the JVM etc.).

Additionally, you can't put one jar into another. However, you could unpackage the driver jar and include the contents in your jar, if you want that. The Maven assembly plugin has a goal that does this: jar-with-dependencies.

To solve your ClassNotFoundException, you'll need to add the sqllite jar to the classpath

see: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html

My preference is to use a utility called one jar. You can use call it from ant or maven and I use it both for work and my personal projects. I have a decent blog article that explains how to use it: Building Self Contained Executable Jars 2 ways

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