Installing Java and RXTX lib

There's a great guide on installing the right stuff to get java and arduino running at:

Here's a condensed version:

First if you havent done this already install java runtime environment:

On Ubuntu:



$ sudo apt-get install sun-java6-jre

now to the development kit:

Java Development kit (JDK) 

  • $ sudo apt-get install sun-java6-jdk
  • $ sudo update-java-alternatives --set java-6-sun
  • $ sudo update-alternatives --config java

The rxtx serial comunications library.

  • Download the Linux binary .zip file from RXTX wiki. (I downloaded
  • Unzip and copy:, and RXTXcomm.jar.
  • Copy those files to your JRE so Java will find them. (I found mine here: /usr/lib/jvm/java-6-sun-

Now go to the program directory. There's a great little addon to Nautilus that allows you to right click - open terminal from a directory to make this step faster. To get that type: sudo apt-get install nautilus-open-terminal.

Soon as your in terminal and in the directory:

To Compile: $ javac *.java
To Run $ java programName

Make sure at this point however that you have uploaded the firmware on to the Arduino else nothing much will happen.

On Windows

Download and install Java JDK from here:

For installation instructions including setting the class path have a look here:



Download and install the RXTX library from here RXTX wiki.

Open a cmd.exe terminal and find the directory of the program you want to compile.

Then type:

To Compile: $ javac *.java



To Run $ java programName







maccioni's picture

Re: Compiling from source


I've followed all the described steps and when compiling javac *.java I get the following error cannot find symbol

symbol: class SerialPortEventListener

class ArduinoComm implements SerialPortEventListener

Thanks ibn advance,