• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Loading a resource

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic