But when I compile the game and run it, it prints out this (it prints out the stuff that is in the same directory as the JAR file is). Images, and sound are working fine. It's just the XML file that is causing this.

How do I make Java read XML files from res folder like it does for images and sound in Eclipse?

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.
If this question can be reworded to fit the rules in the help center, please edit the question.

1

This question isn't really gamedev related. It would be better suited for stackoverflow
–
bummzackMay 1 '13 at 20:58

Ok so i made it absolute path but now this happends : shrani.si/f/2H/13W/131vAM3/error3.png , so my question is shouldnt the absolute path have filename inluded, the name of the file was 5.jar but it was not shown in the absolute path
–
MatthewMay 2 '13 at 10:16

The absolute path is composed out of: DirPath + RelativePath + Filename. If you are trying to get the jar, your dirPath should be something like C:\Project\Particles and your relativePath \res (\bin) and the filaname a.xml (b.jar). Hope this clarifies it a bit.
–
CristinaMay 2 '13 at 10:19

Shouldnt the path be something like this for this case D:\PathToJar\game.jar\res\particles\particleXmlFile.xml , because the particlexml file is inside the game.jar
–
MatthewMay 2 '13 at 10:33