Resolving File paths – ‘File not found’ error in Eclipse Use getClass().getResource() to read a file in the classpath: Complete code: