1) You can use getResource() within your code to find a properties file that
is included in your jar. Check out Class.getResource() and
Classloader.getResource().

2) The longer way around is to locate the jar and extract the resource
manually : http://www.javaworld.com/javatips/jw-javatip49.html

~akb


| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
| Behalf Of Harold Meder
| Sent: Sunday, December 14, 2003 7:53 PM
| To: [EMAIL PROTECTED]
| Subject: [Juglist] Where is that Properties File
|
|
| I have defined a properties file for my java application.  It
| lives in a folder with my java code.  Eclipse nicely moves it over to
| my classes folder, where it also places my class files.
| Everything works nicely.
|
| I package up my application into a jar file, including the
| properties file.  My application can no longer find the properties file.
| Of course, if I copy my properties file into an appropriate
| folder structure in a folder listed in my class path, it works again.
|
| I do not want to have to deploy my application with my properties
| file outside the jar file.  Not this one anyway.
|
| How can I get my application to find my properties file inside of
| the jar file?  What is the proper what to deploy properties files
| with your application?
|
| Thank you,
|    Harold Meder.
|
|
|
| _______________________________________________
| Juglist mailing list
| [EMAIL PROTECTED]
| http://trijug.org/mailman/listinfo/juglist_trijug.org


_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to