Go Down

Topic: Setup Eclipse for Java on WinXP SP3? (Read 2230 times) previous topic - next topic


Oct 09, 2012, 10:38 am Last Edit: Oct 09, 2012, 10:40 am by louarnold Reason: 1
I have hopes of using Eclipse (Juno Service Release 1) for Java SE (not the JEE part) on Win XP to write desktop programs talking to the Arduino. I tried the set-up instructions here http://www.arduino.cc/playground/Interfacing/Java, but I get source code errors for the Java Sample Code. All imports starting with  "gnu.io..." give the error:"The import gnu cannot be resolved", so I don't think the compiler sees the RXTXComm.jar file where those classes are.

As the instructions seem to indicate, I placed a copy of rxtxSerial.dll into "C:\Windows\System32" and into "C:\Program Files\Java\jdk1.6.0_25\bin". I placed a copy of "RXTXComm.jar" into "C:\Program Files\Java\jdk1.6.0_25\lib".

My CLASSPATH is "C:\Program Files\Java\jdk1.6.0_25\lib;C:\arduino-1.0.1\lib"
My PATH is: C:\WINDOWS\system32; C:\Program Files\Java\jdk1.6.0_25\bin C:\arduino-1.0.1 + others not related to this problem.
My JAVA_HOME variable is: "C:\Program Files\Java\jdk1.6.0_25"

I am also pretty rusty with Eclipse, so I may not have properly set up the project.


Oct 09, 2012, 07:11 pm Last Edit: Oct 09, 2012, 07:33 pm by louarnold Reason: 1
I have solved this.
The essential part of the solution was to add an external Jar file - in this RXTXcomm.jar.
I followed this http://www.vogella.com/articles/Eclipse/article.html#eclipseoverview tutorial to get back on track with Eclipse. It has a section describing how to add an external jar file to a project. After that all the import gnu.io... references were resolved. It did seem to help to create a package and then a class file for the sample code.

When I added the external RXTXComm.jar (library) file, I referenced the "C:\arduino-1.0.1\lib" folder where the file resides. It might be best if it was put in the same folder as the project.

I removed all copies of rxtxserial.dll and RXTXComm.jar except from the Arduino IDE folder. BUT having Eclipse execute the sample code still works. I thought that it needed access to the rxtxserial.dll file. So I'm stumped on this. Perhaps its the PATH segment that lets it work.

The CLASSPATH is still: "C:\Program Files\Java\jdk1.6.0_25\lib;C:\arduino-1.0.1\lib"
The PATH still contains: "C:\Program Files\Java\jdk1.6.0_25\bin; C:\arduino-1.0.1"
The JAVA_Home is still: "C:\Program Files\Java\jdk1.6.0_25"

Given that Eclipse and Java run on Linux, Windows XP, and the Mac, and that Eclipse seems to run at good speed, thi seems like the best alternative for writing GUIs that let on interact with the Arduino-resident software.

Go Up