We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Serial Port Issues when using Eclipse
Page Index Toggle Pages: 1
Serial Port Issues when using Eclipse (Read 1300 times)
Serial Port Issues when using Eclipse
Mar 8th, 2007, 5:01am
 
Hullo,
I know this topic has existing threads but I've had no replies and I'm getting rather desperate. I've tried implementing solutions as per previous topics;

Added core, RXTX and serial jars to build path and set native library paths to libraries/serial/library.

But don't seem be resolving my error messages.  Running Ubuntu and using Processing core 0124 in Eclipse:

Code (Just a simple test):

package com.nitroushead.fyp;

import processing.core.*;
import processing.serial.*;
import gnu.io.*;

public class SerialIn extends PApplet {

Serial inputPort;
String In = null;

public SerialIn() {
System.out.println(Serial.list()[0]);
}

public static void main(String args[]) {
SerialIn serialIn = new SerialIn();
}
}

Error:

java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at com.nitroushead.fyp.SerialIn.<init>(SerialIn.java:14)
at com.nitroushead.fyp.SerialIn.main(SerialIn.java:19)
Experimental:  JNI_OnLoad called.
Re: Serial Port Issues when using Eclipse
Reply #1 - Mar 9th, 2007, 5:28pm
 
if that desperate, why not use processing itself? this is the point of having the development environment, that dealing with issues like this is totally frustrating for users who are getting started (it's not just because we wanted a brown ui for developing code, or the nerd pride of saying we had our own dev environment). dealing with classpath and native library confusion are a nightmare. have you even tried this in processing itself and know that your comm ports are working?

for me personally, i've spent a lot of time trying to make this kind of thing easier inside the pde itself, so if you're not interested in using the solution i've invested time into, then i'm less inclined to spend time helping. as such, i rely on others to answer more of the 'integration' questions.

this isn't a criticism of you or anyone using eclipse! i realy need to make a note of this as part of a faq for the integration forum. i totally love eclipse, but just know what you're getting into. buy a java book, learn how native libraries work, how paths work in java, and all the other mess of working as a java developer and building more complex applications that use native libraries and jar files.
Re: Serial Port Issues when using Eclipse
Reply #2 - Mar 9th, 2007, 6:50pm
 
No, i totally realise the point of processing. However, there are some issues there:

I originally turned to processing after attempting to use the javacomm and RXTX libs with my eclipse IDE, after literally a week of searching forums I had still failed to get even close to having working interface with my Wiring board.

I decided to turn to processing to help me with the serial side of my application and it worked like a dream, however unfortunately I ran into problems with the OSCP5 library in processing and spent yet another week trying to iron these out by posting on this forum.  Unfortunately, no such luck, so i've now gone back to eclipse and an interface I have much more experience of tbh; only to find im having problems importing the processing library for serial support.

So I clearly understand the benefits of processing and spent quite some time writing a program in it (You can find this under another post I made regarding OSCP5).  However, i made the decision to go back to eclipse because it is a more comprehensive development environment
Re: Serial Port Issues when using Eclipse
Reply #3 - Mar 9th, 2007, 6:59pm
 
Btw, I do actually know how the libraries work; but unfortunately having followed the solutions posted only to find yet more problems where others have succeeded I'm inclined to ask questions.

And yes of course i've tried this in processing itself.  It works fine, but that's not the issue.
Page Index Toggle Pages: 1