1. When I want to access files/images, I have to do "res/images/blah.png" or "res/maps/map.txt". However when I look at the bin folder, I see that the images folder from res has been copied. Thus I would assume ImageIcon("images/blah.png").getImage() would work. But it fails. Anyone know why?
2. When I execute the game with Eclipse, it runs! However, when I make an executable JAR file, it doesn't work. Why? It can't find "res/map/blah.txt". Is there any way for both Eclipse and a JAR file to work without changing the paths in the source?
Question
Executor89
This is my project:
bin/*blah*
src/Game.java
res/images/blah*.png
I am using Eclipse.
1. When I want to access files/images, I have to do "res/images/blah.png" or "res/maps/map.txt". However when I look at the bin folder, I see that the images folder from res has been copied. Thus I would assume ImageIcon("images/blah.png").getImage() would work. But it fails. Anyone know why?
2. When I execute the game with Eclipse, it runs! However, when I make an executable JAR file, it doesn't work. Why? It can't find "res/map/blah.txt". Is there any way for both Eclipse and a JAR file to work without changing the paths in the source?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts