You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just getting started with Processing, using the Processing plugin in Eclipse.
Ubuntu 11.04
Eclipse 3.5.2
Processing Plug-In for Eclipse 0.3.1.201010191219
I've got a very simple 'sketch' that works, until I try to import the serial libraries.
eg:
void setup(){
// screen size
size(300,315);
}
void draw(){
ellipse(50,50,80,80);
}
as soon as I add the import command, it fails:
import processing.serial.*;
void setup(){
// screen size
size(300,315);
}
void draw(){
ellipse(50,50,80,80);
}
The preprocessed output shows the red 'x' on the import line, saying 'The import processing.serial cannot be resolved
When checking Java Build Path/libraries in the project properties, I see that the serial library is trying to be included, but the path and filename are wrong.
The filename (which should be "serial.jar") is listed as "O.jar"
The path (which should end in "...Resources/libraries/serial/library") actually ends in "...Resources/libraries/serial/library/Serial I(missing)"
The issue is that the name of the library is "Serial I/O". In linux, this name is interpreted as a folder called "Serial I" and a file called "O".
The solution is to edit the file "...Resources\libraries\serial\library\export.txt" and change the first line from
name = Serial I/O
to
name = serial
I reloaded Eclipse at this point, but it may not be necessary. The red 'x' in the preprocessed file disappeared and both code fragments executed identically.
From alan.hig...@gmail.com on June 16, 2011 19:07:37
Rather than open a second ticket, I'm commenting on this one.
This solution only works when there isn't any serial code other than the import statement. As soon as any actual serial calls are made, the program blows up because it can't find a class definition for SerialPortEventListener.
For example, this code (from the serial.list() page on processing.org) complains with java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener:
// Example by Tom Igoe
import processing.serial.*;
// The serial port
Serial myPort;
// List all the available serial ports
println(Serial.list());
I've determined that there also needs to be a java build path library entry for the RXTXcomm.jar file, and that entry needs to include the location of the native resources for that library.
Unfortunately, the plugin ships with native resources for windows (dll) and mac(jnilib), but not for linux(so).
In contrast, the regular processing distribution (I downloaded v1.5.1) has native resources for macosx,windows32,windows64,linux32 and linux64
A workaround is to manually add the reference to both RXTXcomm.jar and the appropriate native resources (in my case, processing-1.5.1/modes/java/libraries/serial/library/linux32/librxtxSerial.so). The extremely unfortunate part is that the plugin refreshes the java build path values during each build, so this sequence of steps must be performed after each build, which is a huge pain.
A thread that led me in the right direction can be found here:
Original author: alan.hig...@gmail.com (June 16, 2011 15:01:15)
I'm just getting started with Processing, using the Processing plugin in Eclipse.
Ubuntu 11.04
Eclipse 3.5.2
Processing Plug-In for Eclipse 0.3.1.201010191219
I've got a very simple 'sketch' that works, until I try to import the serial libraries.
eg:
void setup(){
// screen size
size(300,315);
}
void draw(){
ellipse(50,50,80,80);
}
as soon as I add the import command, it fails:
import processing.serial.*;
void setup(){
// screen size
size(300,315);
}
void draw(){
ellipse(50,50,80,80);
}
The preprocessed output shows the red 'x' on the import line, saying 'The import processing.serial cannot be resolved
When checking Java Build Path/libraries in the project properties, I see that the serial library is trying to be included, but the path and filename are wrong.
The filename (which should be "serial.jar") is listed as "O.jar"
The path (which should end in "...Resources/libraries/serial/library") actually ends in "...Resources/libraries/serial/library/Serial I(missing)"
The issue is that the name of the library is "Serial I/O". In linux, this name is interpreted as a folder called "Serial I" and a file called "O".
The solution is to edit the file "...Resources\libraries\serial\library\export.txt" and change the first line from
name = Serial I/O
to
name = serial
I reloaded Eclipse at this point, but it may not be necessary. The red 'x' in the preprocessed file disappeared and both code fragments executed identically.
Original issue: http://code.google.com/p/processing/issues/detail?id=728
The text was updated successfully, but these errors were encountered: