Installing Java and RXTX lib

There's a guide on installing the necesary tools to get Java and Arduino running at:

Here's a condensed version:

First, if you haven't done this already, install the java runtime environment:

On Ubuntu:

$ sudo apt-get install sun-java6-jre

Install the Java 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.
  • to your JRE so Java will find them. (I found mine here: /usr/lib/jvm/java-6-sun-

Go to the program directory. There's a Nautilus add-on that enables 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.

Start a terminal session:

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

Make sure you have uploaded the firmwareto the Arduino, else nothing much will happen.

On Windows

Download the JDK from here:

Installation instructions, including setting the class path, are here:

Download the RXTX library from here RXTX wiki. Install the library.

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

To Compile: $ javac *.java

To Run $ java programName