Paul Clapham wrote:
Chuck Barnes wrote:Also, whether we are talking about an ini file, a .properties file or an xml file. how does java know where to find said file inside the jar file? I would still have the same issue using any one of those file types, correct?
It doesn't, of course. You have to tell it by writing suitable code.
But the code you posted originally used a FileInputStream, which can't work because a resource inside a jar isn't a file. If I interpret what you posted there, it looks like the "setting.ini" file is in the same folder as the class named "read" inside the jar. In that case the code you want is this:
And yes, the last part of the file name has no effect on that.
Yes you are correct. that worked!
Wonderful, thanks for the help
....but, i think I don't want to do it that way either..... LMAO. After I thought it about some more, I asked myself, do I really want to be sending out the jar file if only the settings file changes? well no... I only want to send the ini file itself and overwrite the old one.
That is the least amount of steps.
So i think i want it external to the jar, so is that where the manifest comes into play? how is that done? Is it something I can tell the IDE to construct? ie tell it to include the ini file in the dist folder, and in turn the manifest file would reflect that relative path? or is it a manual process?
at least I will know how to package things both in and outside of jars.