how to test retrieving embedded resource while debugging in eclipse

I am going to embed a file into my jar when i deploy.  I want to debug the applicaiton iin Eclipse while using the code the that retrieves the embedded resourece.  Is there a way in which i can do this? (Eclipse is using the class files).
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Why shouldn't you just do this; debugging retrieval is no different
from debugging your program.

Or am I missing something?

You should of course have the resource file in the right directory ......

May be I understand:
you can not debug a .jar unless the source code is available.
The resource file should be besides the class that you use as
a reference for the classloader: that is the place from where you jarred it.
There should be no problem then,
but I advise you to debug classes and after corrections .jar them.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
URL resource = getClass().getResource("x");
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

jjacksnAuthor Commented:
here is the scenario:

right now, I have all my class files that I am still debugging a developing.  I need to test the resource loading part because there is an expected behavior when the key is not embedded in the jar.  however, the jar that it will be embedded in does not exist yet.  I am still debugging a lot of stuff.  therefore, I want to make this call:

URL resource = getClass().getResource("x"); and have it work and not work in different scenarios.
If you build a .jar from the class file tree (!) with the resources
in the right place it will work.

jjacksnAuthor Commented:
I'm trying to do this through the IDE... what would be the steps.  I know I can export the jar, but then I would need to do that for every code change, and i'm going to playing with this for a while so that would be a painfully slow process.  
You don't need to change code to get the resource. It'll work both in and out of a jar as it works by classpath
Mick BarryJava DeveloperCommented:
have the resource in a source folder in eclipse
and then when you build a jar include that source folder in the jar
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.