*
The moose likes JNLP and Web Start and the fly likes Loading a resource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Loading a resource" Watch "Loading a resource" New topic
Author

Loading a resource

John Sutt
Ranch Hand

Joined: Mar 07, 2008
Posts: 42
Dear all,

In the root of my project I have a "resources" folder which, among other things, has a few .properties files.
These files are moved into the root of the .jar file, which I export from this project.

In my code, i read these properties as follows:


I'm not using the following, because, if I understand correctly, this searches relative to the MyClass class,
and hence will not find the file in the root of the .jar file.


Anyways, both of the above URLs were null when started with Java Web Start. I decided to print the classpath,
like this:

The result was


I was suprised not to see my myJar.jar file in here. Is that the reason it fails? And how can I make sure myJar.jar file is in the classpath?

This is in my .jnlp file:



I thought that would be enough to put myJar.jar in the classpath, but apparantly not?
Hope somebody can help me,
John.

SCJP 6 (91%), SCJD (91%)
John Sutt
Ranch Hand

Joined: Mar 07, 2008
Posts: 42
Aha!
The following does seem to work...



I wonder though, why the following, which I also tried, did not work then?



Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading a resource
 
Similar Threads
java.lang.VerifyError:
ant fileproperties optional task problem
Ant usage
injecting a value into a variable from a build process
Classpath problems(?)