Problem is the following - I am writing a program with Eclipse in java.. The resulting folder structure is main project folder: Animal Classification/ inside of it: bin/ , images/, pics/ in the bin/ folder : users/metropolia/allClasses.class
Program starts normally and works -> images are in the folders images/ and pics/ -> they are used by users.metropolia.Hieararchy
But when I create a .jar out of it either through Eclipse or through CMD.exe -> in the folder different from the source folder the jar does not show images even though they are packed inside of it. Inside the Hierarchy.class the path to the images is ("images/name.jpg" or "pics/name.jpg").
Then I tried to use the ClassLoader.getSystemResource("images/name.jpg") - but now the eclipse and the cmd.exe give warnings and dont start the program -> NullPointerException in thread main = mistake in the line where ClassLoader static is used...
I would really appreciate any help
Update:
http://users.metropolia.fi/~artemm/
Download the code from there plz It can be downloaded as SFX-archive or if you are afraid of viruses just download usual RAR archive
I really appreciate your help
Main class is in users/metropolia/Program.java
Update 2:
@MockerTim
THank you very much for your help - now everything works. Moreover, I managed to find one more snag - it didnt call for the images, because the call was : "Fish.jpg" and the picture was : "fish.jpg" - no wonder it could not find anything and gave mistakes.
THank you very much once again, I really appreciate!