Referring to a resource in a jar file
807605Aug 1 2007 — edited Aug 2 2007Hi everybody,
I'm creating a jar file with a text file in it, and my application needs to create an input stream that connects to the file. When I run this on my computer without jarring it, it works fine; the file is in a package called "viewer" and it initializes without a problem. When I export from Eclipse 3.2 into a jar file, though, I get a message when I try to run it that the system can't find the file, even though the path to the package is exactly the same and the package is contained in the jar. I'm not really sure if there's a way to make a self-contained program for this...does anyone know if there's a specific method for referring to a text file resource in a jar?
Thanks,
Jezzica85