loading a resource from a jar file  
Author Message
Ahmed Moustafa





PostPosted: 2004-7-15 3:09:00 Top

java-programmer, loading a resource from a jar file Hi All,

When I generate the jar file from the command line, loading a resource
e.g. text file or gif works fine but when I "export" the jar file from
within eclipse (or using ant), the loading does not work. What is the
difference? And how can I fix this problem?

Thanks in advance,

Ahmed

 
Andrew Thompson





PostPosted: 2004-7-15 4:07:00 Top

java-programmer >> loading a resource from a jar file On Wed, 14 Jul 2004 19:08:42 GMT, Ahmed Moustafa wrote:

> When I generate the jar file from the command line, loading a resource
> e.g. text file or gif works fine but when I "export" the jar file from
> within eclipse (or using ant), the loading does not work. What is the
> difference? And how can I fix this problem?

Put a '.' in column 21 of the glixleblot file.

If that does not work, try describing a
reproducible problem.

> Thanks in advance,

You're welcome.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Ahmed Moustafa





PostPosted: 2004-7-15 7:13:00 Top

java-programmer >> loading a resource from a jar file Andrew Thompson wrote:
> On Wed, 14 Jul 2004 19:08:42 GMT, Ahmed Moustafa wrote:
>
>
>>When I generate the jar file from the command line, loading a resource
>>e.g. text file or gif works fine but when I "export" the jar file from
>>within eclipse (or using ant), the loading does not work. What is the
>>difference? And how can I fix this problem?
>
>
> Put a '.' in column 21 of the glixleblot file.
>
> If that does not work, try describing a
> reproducible problem.

It is a reproducible problem!

getClass().getClassLoader().getResourceAsStream() does not work when I
export the jar from within eclipse but it works fine when I generate the
jar from the command line.