Installing Java and RXTX lib

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

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

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 rxtx-2.1-7-bins-r2.zip)
  • Unzip and copy: librxtxParallel.so, librxtxSerial.so and RXTXcomm.jar.
  • Copy those files 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)

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

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

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

 

 

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

 Hi

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

ArduinoComm.java:16: cannot find symbol

symbol: class SerialPortEventListener

class ArduinoComm implements SerialPortEventListener

Thanks ibn advance,

Fabrizio