I've got a simple java program using pi4j running without a gui, so I made a little gui for it in netbeans. The built jar file runs fine on the raspberry pi, until I try to import pi4j to the libraries of the gui project and use it.
I get this error on the pi:
I have been creating and building the gui with netbeans on my mac and adding the pi4j.jar file into the libraries within that, then copying the built jar file to my pi.[email protected] ~ $ java -jar "TestMachine.jar"
Exception in thread "main" java.lang.NoClassDefFoundError: com/pi4j/io/gpio/GpioFactory
Caused by: java.lang.ClassNotFoundException: com.pi4j.io.gpio.GpioFactory
at java.security.AccessController.doPrivileged(Native Method)
... 1 more
I hope it's some sort of import/reference error. Can anyone please tell me what the problem is or how I can use pi4j in a jar/with a gui?
**Edit - after further reading it seems that it may be as simple as the library not being included when the jar is built?
I'd greatly appreciate it