Communication with Java to my ardruino

You may not invent you own protocol, but use Firmata protocol: Arduino Playground - Firmata
It has some drawbacks (it is binary and can't be used to type in console), but it has some advantages also, f.e. processing and java implementation: GitHub - 4ntoine/Firmata: Firmata pure Java implementation and it already has arduino firmware, so you don't need to write your own.