Jar files
Hi is possible to jar everything up including sound and txt files? This is because when i jar up my java project, it doesnt jar up the sound and txt files, and hence i have to place the txt and sound files next to the jar file in order for the jar file to run properly. Please help,
thanks.
Yeah, I do it all the time. All you have to do is list the sound and text files on the command line as stuff to stick into the jar. (That's using the command-line tool provided by the JDK.)
This is so easy, in fact, that I suspect you must be using some other tool to make your jars? Maybe the jar export facility of an IDE?
Hi all, thank you for all your help, i am using eclipse to jar it up,
and so
i have 2 java packages - its a brown colour, and 2 separate packages for html pages and images - its a grey colour, they are all in the src folder.
The sounds folder and a text file are located in the project folder but not inside the src folder, is this the problem? What can i do, can i either put the sound folder and the txt file inside the src folder or is there a way to jar everything up regardless of it being in the src folder?
thanks.
If I recall correctly, the export function that creates jars has a checkbox that says something like "include non-code resources in this jar" or "also include content from these folders in the jar" and then it has a widget that lets you select folders from the project.
Just examine the export-to-jar wizard more carefully. It's in there. It's been a while since I used Eclipse but when I did I did this sort of thing all the time and it worked fine.