• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Jar file issue

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I created a runnable jar using eclipse. There are 4 classes and 2 properties file that are required in jar file. When i run main method from eclipse, all things work well. But when i try to make it a runnable jar and execute it, it throws an error stating that property file not found. But I can see it in my jar file at specified path.

Between i have used property.load method to load the properties. Is this a problem in a jar file?

Please let me know if any other information is required.

Thanks for your support.

Regards,
Patricia Samuel.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Patricia Samuel wrote:Please let me know if any other information is required.


Well, the code for accessing the property file would be awesome.
 
Sheriff
Posts: 22832
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And the location of the file within the JAR file.

You are using Class(Loader).getResource(AsStream), are you?
 
Patricia Samuel
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob. It works perfectly for me when i used resourcestream.

 
reply
    Bookmark Topic Watch Topic
  • New Topic