This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "jar files" Watch "jar files" New topic

jar files

vaitheeswaran subramanian

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.

I agree. Here's the link:
subject: jar files
Similar Threads
How to use Properties file contents
where to keep .jar file that is called in jsp page
Location of Property files
Jar files & JarOutputStream
Packaging an application