Interfacing Java and Arduino

Try trimming the received text i.e. your input, that will remove the first space and any double spaces.

ELSE

an easy fix that i would use for receiving just ascii numbers would be to write

char e = Serial.read();

if (e >= 48 && e <= 57) { // get just numbers - same as; if (e >= '0' && e <= '9') {
Serial.print(F("we received the number: "));
Serial.println(char(e));
}