ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Problem loading properties file using the CLASSPATH
Date Wed, 07 Apr 2004 12:23:41 GMT
On Wed, 7 Apr 2004, Walter Heestermans
<> wrote:

> InputStream in =
> ClassLoader.getSystemClassLoader().getResourceAsStream
> ("");
> The location of the properties file is searched using the CLASSPATH.
> This works fine in ANT version 1.5.4, but not anymore in ANT version
> 1.6.1.  Probably related to the new classloader implementation. How
> can I solve this issue?

Where exactly is your resource?  Inside a jar that lives in
ANT_HOME/lib, I assume.

The content of ANT_HOME/lib has been on the system CLASSPATH in Ant
1.5.x but no longer is in Ant 1.6.x.

Use getClass().getClassLoader().getResourceAsStream(...)
instead, this will look up the resource in the same classloader that
has loaded your class.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message