It's always a good idea to find out what if happening before using IF tests that depend on the data.
Can you add to your Java program (or write a short new program) so that it can act as a serial monitor to show the data received from the Arduino? The just get the Arduino program to echo back every character it receives. That way you can see what the communication is actually doing.
I don't like Java but I use JRuby on my Linux PC. I wrote a program to communicate between a PC and an Arduino in this Thread. The main example is in Python but in one of the Posts I included the JRuby code - which was actually written before the Python code.
As far as I can see RxTx seems to have disappeared from the web and JSSC is the current equivalent.
...R