I have an image in my resources folder in eclipse that I use, the problem is I do not know how to include it, the absolute path is very long and getResource returns a nullpointer. I have searched google and SO and tried the usual solutions to no avail. The resources folder is in my buildpath, the class I am running the code from is in the buildpath but both of the following returns null.
System.out.println(getClass().getResource("data.txt"));
System.out.println(getClass().getResource("/resources/data.txt"));
Now trying :
System.out.println(getClass().getResource("001.txt"));
Still returns null.
System.out.println(getClass().getResource("/001.txt"));
Also null.
Right clicking the file and finding its path relative to the workspace (right-click file, properties, path)
System.out.println(getClass().getResource("/ovinger/resources/sokoban_levels/001.txt"));
Also null
Here is images of the workspace and the resources folder. The code is being run from "TestSokoban.java"
I was even worried that eclipse lacked the rights to search my desktop, run as admin, still same problem.