tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Peremsky <>
Subject Re: JAR file not finding external properties files
Date Tue, 01 May 2007 21:09:28 GMT
  I just tried this and it does not work either. It is still not finding the property file.
I have verified that the class file in the jar is located at \com\mvp\utils.
  I also tried keeping the jar file in both classes and lib, but I did not expect that to
work, which it didn't.

Rashmi Rubdi <> wrote:
  Hi Mike,

On 5/1/07, Mike Peremsky wrote:
> What do I need to do to get the class in the jar file to find the properties files external
to it?

To access a properties file that is external to the JAR file , add the
full path of the Properties file's folder to the CLASSPATH.

If you add the path of the Properties file to the CLASSPATH, there's
no need to place the properties file under /WEB-INF/classes/ folder ,
it can be located anywhere you want.

After setting the CLASSPATH, the properties file can be accessed
simply by specifying its name.

For example:

If the is placed under


public class TestPropertiesFile {
public static void main(String[] args) {
ResourceBundle props = ResourceBundle.getBundle("mypropertiesfile");
//String planet = (String) props.getObject("planet");
//System.out.println("Planet: " + planet);

> - Mike


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message