This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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.

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