Well as a newline can not be converted to an int
then nextInt
just ain't going to work.
try using nextLine
and then see if you can convert to an Integer to process or convert to newLine to quit.
see http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
and
http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#parseInt(java.lang.String)