Your problem is you are trying to get keyboard input from the console, just remove the scanner lines ie these 2 lines and it will work.
Code:
Scanner keyboard = new Scanner(System.in);
 monthNumber = keyboard.nextInt();
BTW why are you trying to extract the month names from a long string of names, why not use put the names into an array and use the entered month number (minus 1) as an index into the array.