Sunday, 8 September 2013

How do I create a Jar file from my program

How do I create a Jar file from my program

I am using eclipse, and I am having difficulty in creating jar files.
So I have codes like getClass().getResource("/imagesfolder/dog.jpg"). How
would I create Jar files such that the folder containing my images will
also be included. Because error occurs if my Jar file is not in my bin
folder with the class files and the imagesfolder.
I tried File>Export>Java>Executable Jar>Save in desktop but when I double
click it, it does not start. I tried cmd and it worked but with errors
that it can't find imagesfolder.
How will I do a jar file in a separate directory that executes with a
double click

No comments:

Post a Comment