Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a jar file, which includes xml and html files?

Tags:

jar

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.

I am using Eclipse on Windows XP.

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


1 Answers

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

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/

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.

like image 61
Chris Marasti-Georg Avatar answered Nov 04 '25 12:11

Chris Marasti-Georg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!