no phidget21 in jave.library.path - Processing form

Comments & issues
BLop
Fresh meat
Posts: 1
Joined: Tue Oct 14, 2014 4:18 pm
Contact:

no phidget21 in jave.library.path - Processing form

Postby BLop » Tue Oct 14, 2014 4:26 pm

Hi,

I am trying to get the values from a RFID phidget to a processing sketch. The sketch in processing marks an error when I try to run it on OSX

nophidget21 in java.library.path Could not locate the Phidget C library. The mac Phidget21 DMG must be installed.


I already have installed the phidget framework and got installed in Macintosh HD / library / frameworks.

This is the sample code I am using:
----------------------------------
import com.phidgets.*;
import com.phidgets.event.*;

PFont myFont;
RFIDPhidget rfid;

String myTag = "";

int greyvalue = 0;

void setup()
{
size(512, 200);
myFont = loadFont("arial_font.vlw");
textFont(myFont, 18);

try
{
rfid = new RFIDPhidget();

rfid.addTagGainListener(new TagGainListener(){
public void tagGained(TagGainEvent oe){
println(oe);
myTag = oe.getValue();

if(myTag.equals("01023c0b3e")){
greyvalue = 155;
}

if(myTag.equals("13004c2a71")){
greyvalue = 255;
}

}
}
);

rfid.addTagLossListener(new TagLossListener(){
public void tagLost(TagLossEvent oe){
//RFIDTag.process(oe.getValue());
myTag = "";
greyvalue = 0;
}
}
);

Thread thread = new PhidgetThread();
thread.start();
}
catch(Exception e){
}


}

void draw()
{
background(greyvalue);
stroke(255);

textFont(myFont, 20);
text("Interaction Workshop RFID reader", 15, 30);


text(myTag, 15, 170);

}



void stop()
{

try
{
rfid.close();

//super.stop();
}
catch(Exception e){
}

}



class PhidgetThread extends Thread {
public void run(){
try{

rfid.openAny();
rfid.waitForAttachment();

//println("Serial: " + rfid.getSerialNumber());
// println("Outputs: " + rfid.getOutputCount());

rfid.setAntennaOn(true);
rfid.setLEDOn(true);
System.in.read();
}
catch(Exception e){}
}
}

-------------

Any idea what should I do to make it work??

Thanks!

/BLop

nodavid
Fresh meat
Posts: 1
Joined: Tue Nov 11, 2014 6:55 pm
Contact:

Re: no phidget21 in jave.library.path - Processing form

Postby nodavid » Tue Nov 11, 2014 7:00 pm

I've got the same issue. Any thoughts?

Haven't used this RFID reader in a couple of years but it used to work (different machines...updates to the OS, Processing...). The Phidget driver is in System Preferences and reads tags, but I can't get Processing to compile a simple sketch because of this error.

Thanks in advance!
/der

borisbrodsky
Fresh meat
Posts: 1
Joined: Thu Apr 09, 2015 5:01 am
Contact:

Re: no phidget21 in jave.library.path - Processing form

Postby borisbrodsky » Thu Apr 09, 2015 5:07 am

Hi
I have the SAME PROBLEM, in the past my sketch work. With OS X 10.10.3 I have lost the function or the "Phidget C library".

the error is:

"ExceptionInInitializerError: no phidget21 in java.library.pathCould not locate the Fidget C library.The Mac Phidget21 must be installed."

I have re-installed the DMG and Repair the permission after the update of OS. Testing it from preference work, but in processing not.


Please help :roll:
Thanks

Boris

camb416
Phidgetsian
Posts: 5
Joined: Tue Mar 19, 2013 10:06 am
Contact:

Re: no phidget21 in jave.library.path - Processing form

Postby camb416 » Fri Jun 10, 2016 1:41 pm

Did either of you get this working? I'm assuming it has to do with having the right JAR in the code directory (in processing) but I'm doing that and still no dice

Thanks for any help!

hsleiman
Fresh meat
Posts: 2
Joined: Wed Nov 09, 2011 9:41 pm
Contact:

Re: no phidget21 in jave.library.path - Processing form

Postby hsleiman » Thu Jun 30, 2016 12:16 am

I having the same issue except with me I getting only when I redeploy.

even when I close

interfaceKitPhidget.close();
interfaceKitPhidget = null;

I have to restart tomcat and reconnect the device to get it to work again.

Anyone solved yet?

Caused by: java.lang.ExceptionInInitializerError: Native Library /Library/Java/Extensions/libphidget21.jnilib already loaded in another classloader
Could not locate the Phidget C library.
The Mac Phidget21 DMG must be installed.
at com.phidgets.Phidget.<clinit>(Phidget.java:63)
at com.homeautomation.service.phidgets.PhidgetClientService.connectOnterfaceKitPhidget(PhidgetClientService.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

hsleiman
Fresh meat
Posts: 2
Joined: Wed Nov 09, 2011 9:41 pm
Contact:

Re: no phidget21 in jave.library.path - Processing form

Postby hsleiman » Thu Jun 30, 2016 9:30 am

I moved the phidget.jar into the tomcat /lib I think that will fix it.

It slipped my mind to think of that first. Since tomcat is already loading libraries.


But it was complaining about the C library being loaded already.


Return to “General”

Who is online

Users browsing this forum: No registered users and 0 guests