While trying to do maven build on MacBook for Raspberry Pi 3 B+ board I am getting the following errors (I have written a simple program using pi4j library).

The problem is while linking dynamic .so files

    java.lang.UnsatisfiedLinkError: /private/var/folders/93/l56z6ww16875x5v64frr9t3r0000gn/T/libpi4j7469529879656724470.so: dlopen(/private/var/folders/93/l56z6ww16875x5v64frr9t3r0000gn/T/libpi4j7469529879656724470.so, 1): no suitable image found.  Did find:
/private/var/folders/93/l56z6ww16875x5v64frr9t3r0000gn/T/libpi4j7469529879656724470.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00
/private/var/folders/93/l56z6ww16875x5v64frr9t3r0000gn/T/libpi4j7469529879656724470.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00
at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[na:1.8.0_121]
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) ~[na:1.8.0_121]
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) ~[na:1.8.0_121]
at java.lang.Runtime.load0(Runtime.java:809) ~[na:1.8.0_121]
at java.lang.System.load(System.java:1086) ~[na:1.8.0_121]
at com.pi4j.util.NativeLibraryLoader.loadLibraryFromClasspath(NativeLibraryLoader.java:148) ~[pi4j-core-1.1.jar:na]
at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:97) ~[pi4j-core-1.1.jar:na]
at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:189) [pi4j-core-1.1.jar:na]
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:69) [pi4j-core-1.1.jar:na]
at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:51) [pi4j-core-1.1.jar:na]
at com.pi4j.platform.Platform.getGpioProvider(Platform.java:130) [pi4j-core-1.1.jar:na]
at com.pi4j.platform.Platform.getGpioProvider(Platform.java:123) [pi4j-core-1.1.jar:na]
at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:109) [pi4j-core-1.1.jar:na]
at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:56) [pi4j-core-1.1.jar:na]
at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:91) [pi4j-core-1.1.jar:na]
at org.entitylabs.rest.service.LedOnOffService.<init>(LedOnOffService.java:15) [classes/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.8.0_121]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [na:1.8.0_121]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_121]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [na:1.8.0_121]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170) [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1230) [spring-beans-5.0.7.RELEASE.jar:5.0.7.RELEASE]

As raspberry .so could not be found here.

Is there any alternative to build code on MacBook using Maven, so that a built JAR can be transferred to Raspberry directly for execution?

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.