Hi guys,
I've recently inherited a Java application that needs to be deployed on the web using Java Web Start. As it stands, the program must be run from a directory that has a Data folder along with the .jar file. This is because the application needs to access the resources stored in the data folder.
Now, when I try and turn this in to a Web Start App, it doesn't like having to read from the external folder. As it stands, the code to read in the XML is as follows:
Document doc = docBuilder.parse(new File("data" + File.separator + "configFile1.xml"));
So, I'm trying to add everything that is needed to the Jar file, so that when Web Start executes the Jar file, everything it needs is in there. So, if I move configFile1.xml to the root of my jar file, I assumed I could just alter the code to this:
Document doc = docBuilder.parse(new File("/configFile1.xml"));
And it would look for the file in the root of the Jar, where it is. But when I try this, I get a Exception telling me that the file couldn't be found.
So now I am stuck, and I've bern looking at it on and off for about a week now, it's hurting my head. I'd rather not re-write how it parses the XML files, so I'd like to know if this is do-able how I'm trying, or am I completely off?
A Million Internet Cookies to anyone who can help me...
I've recently inherited a Java application that needs to be deployed on the web using Java Web Start. As it stands, the program must be run from a directory that has a Data folder along with the .jar file. This is because the application needs to access the resources stored in the data folder.
Now, when I try and turn this in to a Web Start App, it doesn't like having to read from the external folder. As it stands, the code to read in the XML is as follows:
Document doc = docBuilder.parse(new File("data" + File.separator + "configFile1.xml"));
So, I'm trying to add everything that is needed to the Jar file, so that when Web Start executes the Jar file, everything it needs is in there. So, if I move configFile1.xml to the root of my jar file, I assumed I could just alter the code to this:
Document doc = docBuilder.parse(new File("/configFile1.xml"));
And it would look for the file in the root of the Jar, where it is. But when I try this, I get a Exception telling me that the file couldn't be found.
So now I am stuck, and I've bern looking at it on and off for about a week now, it's hurting my head. I'd rather not re-write how it parses the XML files, so I'd like to know if this is do-able how I'm trying, or am I completely off?
A Million Internet Cookies to anyone who can help me...