This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Property Files (placement of the file in the environment) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Property Files (placement of the file in the environment)" Watch "Property Files (placement of the file in the environment)" New topic
Author

Property Files (placement of the file in the environment)

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
I'm looking to place my property file in my environment. Where should this be placed? How do I know where this class is looking for the properties file? Can someone help??
Dale

------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)


By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Properties are treated as files, and so are discovered relative to the CODEBASE, i,e., wherever in the file system the executing class is.
What I usually do is bundle all my classes into a JAR file, and then put the properties file wherever I care to in the directory structure of the jar. You can also use the -jar option for the VM to "execute" the archive.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Deepak Mahbubani
Ranch Hand

Joined: May 12, 2001
Posts: 68
Originally posted by Dale DeMott:
I'm looking to place my property file in my environment. Where should this be placed? How do I know where this class is looking for the properties file? Can someone help??
Dale


You can place the properties file anywhere in the classpath.
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
Thanks!
------------------
By failing to prepare, you are preparing to fail.
Benjamin Franklin (1706 - 1790)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Property Files (placement of the file in the environment)