Open RickyGo opened 9 years ago
Swap out new FileReader("lambdasinaction/chap3/data.txt")
with new InputStreamReader(ClassLoader.getSystemResourceAsStream("lambdasinaction/chap3/data.txt"))
and it works correctly.
And this worked for me too.
Files.newBufferedReader(Paths.get(ExecuteAround.class.getResource("/lambdasinaction/chap3/data.txt").getPath()))
You can swap for :
try (BufferedReader br = new BufferedReader(new FileReader("src/main/resources/lambdasinaction/chap3/data.txt"))) {
with absolute path.
I think that replace
"lambdasinaction/chap3/data.txt"
withExecuteAround.class.getResource("/lambdasinaction/chap3/data.txt").getPath()
should solve the problem.