Reputation: 901
The image resources folder 'images' are imported and runs successfully on eclipse. But I have problem running this on IntelliJ.
Can someone enlighten me why it doesn't work on eclipse?
Here I tried marking 'images' folder as Sources or resources but none of them works. It is currently not selected because if I select this then it overrides the .classpath file which is currently the same as the one in eclipse.
The image is imported using the following line:
imageMap = ImageIO.read(new File("images/map.png"));
Which works fine in eclipse.
So why does it not work in IntelliJ?
Many thanks in advance,
Upvotes: 0
Views: 177
Reputation: 12521
Print new File("").getAbsolutePath()
to see what your working directory is. You will then probably see that your relative path is wrong. You can change your Working directory in Run configuration.
Upvotes: 1