do u happen to have the java code ...?
Somewhere between the javax.comm packages and the RXTX project there's a collection of demo projects - it should be in with the rest of the sources / classes / libs you'll need to connect to your serial port. Make sure you compile all the demo projects and run them to understand how Java / serial port works. Once you have the demo projects working on your serial port, just look in the source for the fragment of code that does what you want and copy it from there. Remember to include adequate attribution in your comments and any reports you write.
If you don't have access to a working microcontroller yet, you can practice your Java serial programming by finding an old modem with a serial port on it, or a mobile phone with a PC cable (even many USB phone cable connections - particularly older ones - still create a kind of virtual serial port on the PC) may also work. That way you can send Hayes (AT) commands from your Java program and capture the responses from the modem/cellphone.