如何创建包含xml和html文件的jar文件? [英] How do I create a jar file, which includes xml and html files?

查看:218
本文介绍了如何创建包含xml和html文件的jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个jar文件,其中包含一些所需的类和java文件,但我还想包含一些额外的xml,xsl,html,txt(README)文件。

I am trying to create a jar file which includes some class and java files needed, but I also would like to include some extra xml, xsl, html, txt (README) files.

我在Windows XP上使用Eclipse。

I am using Eclipse on Windows XP.

我有一个简单的方法来设置目录结构并将我的所有文件打包到一个jar中?

Is there an easy way for me to set up a directory structure and package all my files into a jar?

推荐答案

将文件添加到源文件夹中,它们可以包含在jar中。

Add the files to a source folder and they can be included in the jar.

一种常见的方法是在项目的根目录下有一个src文件夹。其中包括java文件的文件夹等。类似于:

One common way is to have, at the root of your project, a src folder. Within that, folders for java files, and others. something like:

src/
    css/
    java/
    html/
    images/

然后你可以将每个子文件夹作为源文件夹(右键单击,用作源文件夹),它们应该可以添加到jar中。

Then you can make each of those subfolders a source folder (Right click, Use as Source Folder) and they should be available to add to the jar.

这篇关于如何创建包含xml和html文件的jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆