简体   繁体   English

在Eclipse中导出Runnable JAR时如何控制文件夹结构?

[英]How to control folder structure when exporting a Runnable JAR in Eclipse?

Desired result: A folder named 'examples' in the root of my 'Runnable' JAR. 期望的结果:我的'Runnable'JAR的根目录中名为'examples'的文件夹。

In Eclipse, when clicking 'Export' > 'Runnable JAR file', there is no option to choose which resources to export into the new JAR. 在Eclipse中,单击“导出”>“Runnable JAR文件”时,没有选项可以选择要导出到新JAR的资源。 After I execute the operation to create a 'Runnable JAR file', my 'examples' folders sitting in my project root does not appear in the resultant JAR. 在我执行创建“Runnable JAR文件”的操作后,位于项目根目录中的“examples”文件夹不会出现在生成的JAR中。 Is there a way to use Eclipse's 'Export' > 'Runnable Jar' facility, while still having control over the folder structure of the final result? 有没有办法使用Eclipse的'Export'>'Runnable Jar'工具,同时仍然可以控制最终结果的文件夹结构? (I'm using Eclipse 3.7/Indigo) (我正在使用Eclipse 3.7 / Indigo)

When you export runnable jar file using eclipse, it only export the compiled classes and the libraries. 使用eclipse导出runnable jar文件时,它只导出已编译的类和库。 You can of cause go to project properties -> Java Build Path -> Libraries -> Add Class Folder . 你可以去project properties -> Java Build Path -> Libraries -> Add Class Folder Add the examples folder to the build path and then re-run the export procedure again. examples文件夹添加到构建路径,然后再次重新运行导出过程。 The ideal way would probably use the generated build.xml and modify the target to generated the jar file. 理想的方法可能是使用生成的build.xml并修改目标以生成jar文件。

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

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