Following to some forums answers I\'m using this:
while (fileReader.nextLine() != null) { String line = fileReader.nextLine(); System.out
you should use while (fileReader.hasNextLine())
while (fileReader.hasNextLine())