Thanks,<br /> <br />Tom
Originally posted by T. Blough:
I've downloaded a project from sourceforge (http://jdraw.sourceforge.net) and have made some modifications to it. The program has a call to getClass().getClass().getClassLoader().getResource( path ) where path is "jdomain/jdraw/images" to preload some image files. This works fine when executing within Eclipse and returns the URL encoded path "file:/C:/Documents%20and%20Settings/tblough/My%20Documents/Programming%20Projects/JDraw/bin/jdomain/jdraw/images".
When I make an executable jar of my project, this same call returns null. I've also tried this with the stock code and get the same results. I've verified the images are included in the jar, and the path is the same (and all lowercase). This is being compiled under 1.6.1. The funny thing is that the same code (I assume it's the same code) that is in an executable jar (compiled under 1.4) that comes with the source package works correctly.
The program has a splash screen that is loaded with ResourceLoader.getImage( "jdomain/jdraw/images/logo.png" ) and this works in both cases. ResourceLoader seems to find the specified file on the same path within the Jar without problems, but getResource( "jdomain/jdraw/images" ) is returning null when executed from within the jar.
Any ideas?
Originally posted by Maneesh Godbole:
Eventually I identified the cause to be the case confusion in the file name (logo.png and logo.PNG). Can you confirm that this is not happening in your case?
Originally posted by Maneesh Godbole:
While you are at it, could you also please adjust your display name to confirm with the naming policy?
Thanks,<br /> <br />Tom
Thanks,<br /> <br />Tom
Originally posted by Tom Blough:
.. (which, by the way, DOES confirm with your naming policy).
Originally posted by Norm Radder:
That's interesting, you can put an entry in a jar file for a directory.
How do you do that with the jar command?
What happens if you unzip it with the Winzip command?
Thanks,<br /> <br />Tom
Consider Paul's rocket mass heater. |