JNI/C++/JAVA/terminal/GPIO - Raspberry Pi Forums


my main program java. communicate c++ gpio. i'm using terminal call them jni way.

ok, files working. i'm struggle 1 line. let me tell did.

@ first, in " /opt/pi4j/examples/ko/jni "

did type in terminal:

1) cd /opt/pi4j/examples/ko/jni
2) javac example.java
3) javah –jni example
4) cc –fpic –o libexample.so –shared –i/usr/lib/jvm/jdk-7-oracle-armhf/include -i/usr/lib/jvm/jdk-7-oracle-armhf/include/linux example.cpp –lpigpio –lrt –lpthread
5)export ld_library_path=’/opt/pi4j/examples/ko/jni’
6) java –djava.library.path=. example

, error popped:

code: select all

exception in thread "main" java.lang.unsatisfiedlinkerror: example.print()d         @ example.print(native method)         @ example.main(example.java:9)
checked in java , see is:

code: select all

new example().print();
understand why happens?



raspberrypi



Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62