Installing Java and RXTX lib

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

http://reprap.org/bin/view/Main/RepRapDeveloperInstallLinux

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 rxtx-2.1-7-bins-r2.zip)
  • Unzip and copy: librxtxParallel.so, librxtxSerial.so and RXTXcomm.jar.
  • to your JRE so Java will find them. (I found mine here: /usr/lib/jvm/java-6-sun-1.6.0.13/jre/lib/ext)

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: http://java.sun.com/javase/downloads/index.jsp

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

http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html

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