Small change in how the file is read in Java Interface

It was grabbing an extra character at the end of each word.