Send data to arduino from PC in java over Serial (RXTXlib)

@PaulS is correct - I hadn't spotted that.

When the PC program opens the Serial port the Arduino resets - which takes a few seconds. Your Java program must leave the Serial port open all the time it is in communication with the Arduino and it must allow time for the Arduino to reset after opening the Serial port.

...R