• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading a resource

 
John Sutt
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
John Sutt
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha!
The following does seem to work...



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



Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic