| Author |
Eclipse JAR Problem
|
Kevin Adu-Sarkodie
Greenhorn
Joined: Feb 28, 2011
Posts: 7
|
|
Hey Guys,
I got a problem with creating a Executable JAR in Eclipse.
My application uses images and when I try to run the JAR that Eclipse creates it doesn't find the image files.
I keep my images in a separate folder called images along with the src folder and others in the project.
It detects them fine when I run it in Eclipse.
The way I access the images in my Java code is like this:
I have also tried this way:
And neither way works.
I was hoping if anyone can help me, Thanks.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8434
|
|
getClass().getResource() is the correct way to access jarred resources.
However you need to supply the name of the resource.
How do you expect blank quotes to work?
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
 |
|
|
subject: Eclipse JAR Problem
|
|
|