Your code uses next() to read one word from the file. Are all the words on the same line or is each word on a separate line? If on separate lines you should use the nextLine() method to read them.
...