Although the getResourceAsStream doesn'twork for me, I changed the statement to:BufferedReader br = new BufferedReader(new InputStreamReader(newFileInputStream(fileName), encoding));and it seems to be working fine.