Two Laptop Bag*
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 Android Security Essentials Live Lessons this week in the Android 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)
 
Similar Threads
environment variables and substitution into properties
Setting environment variable in ANT
Another "No suitable driver found for ..." error -- yes, it does find the driver
Classpath Build Order Changes (entries in .classpath file keep becoming reset)
Managing test environments