my dog learned polymorphism*
The moose likes Java in General and the fly likes Jar file issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Jar file issue" Watch "Jar file issue" New topic
Author

Jar file issue

Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300
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.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Well, the code for accessing the property file would be awesome.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

And the location of the file within the JAR file.

You are using Class(Loader).getResource(AsStream), are you?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Patricia Samuel
Ranch Hand

Joined: Sep 12, 2007
Posts: 300
Thanks Rob. It works perfectly for me when i used resourcestream.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar file issue