When you call
Scanner.nextInt();
followed by
Scanner.nextLine();
means the nextLine()
will read the rest of the line after the number. You might not have entered anything after the number so nextLine returns empty String "" which you can see in your Exception thrown.
The simple way around this is to call
int option = scanner.nextInt();
scanner.nextLine(); // ignore the rest of the line.
// now reads the next line
String line = scanner.nextLine();
Most likely you have a negative number. If you have a number which is (top bit is set 1) 10101010 ... 1010101 and is 32-bits long, this is too large to store in a 32-bit signed int. You can parse it as a Long and cast it to an (int)
You have the same problem with trying to parse a 64-bit binary as a Long. In this case you have to use a BigInteger and cast this to a long, or write your own parser.