我试图在Eclipse中导出一个可运行的jar,但是我需要它包含运行我的程序所需的一些其他文件 [英] I'm trying to export a runnable jar in Eclipse, but I need it to include some other files necessary for running my program
问题描述
您的资产目录是否在Eclipse中被声明为源文件夹?
右键单击文件夹,选择Build Path-> Use as Source Folder。然后重试导出。
从长远来看,您应该真正看到一个构建工具,如maven或ant,它们更灵活,而且更少依赖于Eclipse,所以Eclipse中项目配置的更改不会影响最终的构建。
Specifically, I am using JDBC libraries to work with databases in my Java program. When I do "Export Runnable Jar" in Eclsipe, it includes the referenced libraries but I am never given an optino to include my assets folder (containing the databases) in the runnable jar file. If I try to export a regular jar file via Eclipse, I can add the assets folder, but the referenced libraries are not included. What should I do here? Thanks a lot.
Are your asset directories declared as Source Folders in Eclipse?
Right Click on the folder, choose Build Path->Use as Source Folder. Then retry the export.
In the longer term, you should really be looking at a build tool such as maven or ant, they are much more flexible, and they are less dependent on Eclipse, so changes in your project configuration in Eclipse won't affect the final build so much.
这篇关于我试图在Eclipse中导出一个可运行的jar,但是我需要它包含运行我的程序所需的一些其他文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!