Why scanner is not working in java