Hello,
I have some problem in executing the jar file... I have following scenario:
1. In normal scenario (if i don't have a jar file)...say I am creating a directory
project..this will be my parent dir and i'll have
test (this will have all class files) and
images (this will have all images) as subdirectory of
project. To run my program i have to go to my project dir at command prompt and can run by
c:\project>java test.app (where app is my main class). and it runs very well.
2. Now I tried creating a executable jar with following cmmand
c:\project>jar cvf temp.jar test/*.* images/*.* entrypoint.mf while entrypoint.mf has following line with an extra carriage return at the end:
Main-Class: test/app when I issue following command at the prompt:
c:\project>java -jar temp.jar my programs runs prefectly fine.Take care it also has test and images folder also with all relative files extracted as this was original folder from where I have created the jar file. But if i copy this jar file into another folder say newProject and try to run program like this:
c:\newProgram>java -jar temp.jar it runs my program but without the images...why?
1. Is jar file itself not contains all information for every files it has included?
2. Do I have to include images directory and others (except class files) separately?
3. What is a solutions for it? where am I wrong?
Please help me sort the issue..
regards,
Arun