gnu does not exist

edited August 2014 in Library Questions

Hi,

I am trying to open an example of org.onsignal.rfid to read RFID with my Processing 2.1.1. But when I try to run the program, I get the following errors:

The package "gnu" does not exist. You might be missing a library.

I can open the example when I am using Processing 1.5.1. May I know what I am missing on Processing 2.1.1? Thank you.

Answers

  • Who knows? Processing 2 series lost many deployment & flexibility features! :O)

  • I am pretty sure that GNU exists! :-)

    As said, you are missing a library. Have you installed the dependencies of this sketch?

  • edited August 2014

    I am sorry I do not understand what is the dependencies of this sketch... (I am new to Processing:( ) So GNU have a library for processing 2.1.1? Or maybe I post the example code here:

    import processing.serial.*;
    import org.onsignal.rfid.*; 
    import gnu.io.*; // for the exceptions
    
    RFIDReader rfid_reader;
    String rfid_name;
    
    void setup() {
      rfid_name    = Serial.list()[0];
      rfid_reader  = new RFIDReader();
      try{rfid_reader  = new RFIDReader(rfid_name, new TagListener());}
      catch (NoSuchPortException e) { println("RFID Port: "+rfid_name+" was not found!"); }
      catch (PortInUseException e) { println("RFID Port: "+rfid_name+" is in use by another program."); }
    }
    
    void draw(){}
    
    class TagListener implements RFIDListener
    {
      void tagAdded(RFIDTagEvent e) {
        if(e.getReader().toString().equals("[RFID Reader @ " + rfid_name + "]"))
        {println(e.getTag());}
      }
      void tagRemoved(RFIDTagEvent e) {
        if(e.getReader().toString().equals("[RFID Reader @ " + rfid_name + "]"))
        {println(e.getTag());}
      }
    }
    
  • The problem is in the import gnu.io.*; line.
    I suppose this package is supposed to come with the RFID library. How did you install it?

    Side note: remove the line 10, it is redundant with the next one, and can cause you problems after you solved your current issue.

  • edited August 2014

    I am sorry I miss the instructions and thanks for your kindly reminder.

    The RFID library I downloaded from internet do not have "gnu" library. I found that the RFID library also have import gnu.io.*; So I am thinking the gnu library is included in Processing 1.5.1. I found the following code inside Processing1.5.1 > Contents > Resources > Java > modes > java > libraries > serial > src > processing > serial > Serial.java

    package processing.serial;
    import processing.core.*;
    
    import gnu.io.*;
    
    import java.io.*;
    import java.util.*;
    import java.lang.reflect.*;
    

    But I found the same file in Processing 2.1.1 is

    package processing.serial;
    
    import processing.core.*;
    
    import java.lang.reflect.*;
    import java.util.Map;
    
    import jssc.*;
    

    However I still can not find the gnu library inside the Processing 1.5.1....

  • It is in the file RXTXcomm.jar

Sign In or Register to comment.