I am new to Java Web Start. I need to be able to read a file from the jar. My application has many configuration files along with some input files, and I need to be able to access them. I have tried every way that you suggest, but I keep getting a null. It cannot find the resource. I am at my wits end. I tried both the Rachel suggestions and also the Resource Loading Tutorial and I keep getting a null when I get the resource. All the examples that I see are for icons and properties. I made sure that the file exists in the jar. I made sure that the file path was correct. I made sure I was getting the correct classloader. Any suggestions? My signed jar file is nxm.jar and when I look inside I can see the file is: nxm\sys\cfg\commands.cnf The code that I am using (at this point I went back to the classloader) ... String resourceName; ClassLoader resourceLoader = ResourceAnchor.class.getClassLoader(); URL resourcePath = new URL( resourceLoader.getResource(resourceName) ); ... Note: -When I printout the "resourceName" it is nxm\sys\cfg\commands.cnf -I am on a Windows NT platform What am I doing wrong? Thanks in Advance, Lisa Boslett
Hava you tested the Jar-file without the JNLP file? for example: java -jar Program.jar Make sure you have added a Manifest file to the Jar-file. If this works, and the JNLP doesn't work, I think you've made a mistake while building up the JNLP file.