NoClassDefFoundError: com/phidget22/Parity

Supporting Java SE version 7 and up
Post Reply
dmccue128@gmail.com
Fresh meat
Posts: 1
Joined: Tue Dec 20, 2022 7:42 am
Contact:

NoClassDefFoundError: com/phidget22/Parity

Post by dmccue128@gmail.com »

I copied an example program from https://www.phidgets.com/?view=api, but I cannot get it to run:

Example code from method open():

import com.phidget22.*;

class Example {
public static void main(String[] args) {
try {
VoltageInput ch = new VoltageInput();
ch.open();

ch.close();
} catch (PhidgetException ex) {
System.out.println("Failure: " + ex);
}
}
}

Compiled on Ubuntu Linux 20.04.5 LTS using OpenJDK 1.8.0_352:
$ javac Example.java

When I run the program, it fails with NoClassDefFoundError: com/phidget22/Parity:
$ java Example -cp phidget22.jar
Couldn't FindClass com/phidget22/ParityException in thread "main" java.lang.NoClassDefFoundError: com/phidget22/Parity

It is true I cannot find this class in the src directory of the libphidgetjava build. What is wrong?

Is there a class, "Parity" or "ParityException"? I'm guessing my installation is corrupt somehow? Ideas?
User avatar
Patrick
Lead Developer
Posts: 3399
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: NoClassDefFoundError: com/phidget22/Parity

Post by Patrick »

Your phidget22 C library and phidget22.jar are out of sync. Parity is an unused class which was renamed DataAdapterParity.

Update your installed libphidet22/libphidget22java.

-Patrick
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests