loading a resource from a jar file

Discussion in 'Java' started by Ahmed Moustafa, Jul 14, 2004.

  1. 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
    Ahmed Moustafa, Jul 14, 2004
    #1
    1. Advertising

  2. 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
    Andrew Thompson, Jul 14, 2004
    #2
    1. Advertising

  3. 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.
    Ahmed Moustafa, Jul 15, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lucy
    Replies:
    6
    Views:
    30,564
    steve
    Sep 7, 2004
  2. Arnold Peters
    Replies:
    0
    Views:
    554
    Arnold Peters
    Jan 5, 2005
  3. muttley
    Replies:
    0
    Views:
    2,688
    muttley
    Oct 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,726
    Roedy Green
    Feb 14, 2006
  5. Arnold Peters
    Replies:
    0
    Views:
    638
    Arnold Peters
    Jan 5, 2005
Loading...

Share This Page