We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Here is Sketch code from https://www.processing.org/reference/libraries/ (the Serial example). I am trying to execute the code using the Java IDE. package processing2;
import processing.core.*; import processing.serial.*;
public class Sketch extends PApplet { public void setup() { // Example by Tom Igoe
// The serial port:
Serial myPort;
// List all the available serial ports:
printArray(Serial.list());
// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[0], 9600);
// Send a capital A out the serial port:
myPort.write(65);
noLoop();
}
static public void main(String[] passedArgs) {
PApplet.main(new String[] {"processing2.Sketch"});
}
}
Exception generated by code printArray(Serial.list()); is below. I don't know how to fix. Suggestions greatly appreciated.
java.lang.NoClassDefFoundError: jssc/SerialPortEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:455) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:367) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at processing2.Sketch.setup(Sketch.java:14) at processing.core.PApplet.handleDraw(PApplet.java:2393) at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1540) at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316) Caused by: java.lang.ClassNotFoundException: jssc.SerialPortEventListener at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 16 more