This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "jar files" Watch "jar files" New topic
Author

jar files

vaitheeswaran subramanian
Greenhorn

Joined: Jan 06, 2005
Posts: 15
i would like to add a properties file in the jar package and i want the class files in the package to access the properties file. i always get a file not found error. what is the way of implementing it.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Are you using Classloader.getResourceAsStream() to open the file? Since there's no actual file (it's in the JAR), you can't get to it using the normal File operations.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
Have you checked out Aspose?
 
subject: jar files
 
It's not a secret anymore!