file within jar

I created a jar file for my application using eclipse

within my project i have some file my application uses as images

i have a issue with the path to write to access those files

currently although all those files are already in the jar i have to create a folder duplicate those files and copy the jar in that folder to be able to use my resources.

to be more specific assuming i have

Package1

Package1.class1

Package2

Package2.image

what will be the path to write in class1 to open the image file?

I print out the directory while the program is running and it is the directory in which the jar file is

so i use this path

./myproject.jar/package2/images

in class1 code but it can not find the file(no such file error)

My question is what is the path to write in class1 to open a file located in package 2

Thanks

[913 byte] By [lildavesflavaa] at [2007-11-27 4:27:09]
# 1

The relative path to an image file or other resource file is always in relation to the current class file that is executing.

So your class in Package1 cannot have access to an image in Package2.

It is just impossible.

The only way to do this is to move your image files at a location relative to the class that requires the files within Package1.

maple_shafta at 2007-7-12 9:35:43 > top of Java-index,Desktop,Deploying...
# 2
roger
lildavesflavaa at 2007-7-12 9:35:43 > top of Java-index,Desktop,Deploying...