I read through this topic and right now sending and receiving serial data via Serial Monitor is no problem at all.
But actually I want to send serial data to my arduino using Java. To do that, I am using the JSSC library. But for some reason my Arduino does not react to anything I send to it.
I think it might have something to do with the data that is sent. JSSC only offers to write Strings, Integers and Bytes, but my sketch is waiting for a char. Perhaps someone can tell me more.
Please post your code using code tags (the </> button on the toolbar above the reply window). Many people won't bother going to look at external links.
If you get a message about the code being too long, there is an attachments option below the reply window.
A common problem with PC programs is that the programmer does not allow time for the Arduino to reset after the PC program opens the serial port. It is also important for the PC program to keep the serial port open until it is completely finished using the Arduino.
I am not good with Java but I have used JSSC with JRuby. There is a JRuby program (as well as Python) in this demo.
The Arduino IDE itself is written in Java, and it can communicate to the serial port via the RXTX Java library. That library is very similar to the Java Communications API extension. RXTX Java library is based on JNI (Java Native Interface, C extension). C is still killer program language.
One trick is install IDE will automatically installed RXTX Java library.