Using pi4j to control GPIO

38 16243
[COMPILE] gcc -c -O3 -Wall -I/usr/lib/jvm/jdk-7-oracle-armhf/include -I/usr/lib/jvm/jdk-7-oracle-armhf/include/linux -I/usr/local/include -I/usr/local/include/linux -Winline -pipe -L/usr/local/lib /usr/local/lib/libwiringPi.a /usr/local/lib/libwiringPiDev.a  com_pi4j_jni_I2C.c
gcc: error: /usr/local/lib/libwiringPi.a: No such file or directory
make: *** [com_pi4j_jni_I2C.o] Error 1

I have this error on making Pi4J
i reinstalled WiringBP and its works
i intalled RPi.GPIO_BP and its works

I do not know what to do

For this Error I can get you a short tutorial:

First go to wiringbp directory. On my Banana Pi with Rapsian for Banana it is pre installed at /opt/api-lib/WiringBP. Depends on your installation where you locate it.
In WiringBP you find two directories you need. The devLib and the wiringPi.
Switch to devLib and Enter:  
> sudo make static
> make installt-static
repeat this in wiringPi
After these two steps, you should have the missing file.
Now you can try to build your Pi4J again.

Tell us about results, good luck.


I'm new here and need some further help. Read all your posts an get WiringBP and Pi4J installed on my Banana Pi with Raspian for Banana.

Gpio readall works
Gpio export works
Gpio write works

But is I start my Java App with only a single Pin to get high an Error occurs:
"Unable to determine hardware version. I see Hardware: sun7i ´ - expecting BCM2708 or BCM2709. Please report this to

Surly and wrote to the adress. But this is only support for Raspberry Pi.

Can anybody get me some ideas to fix this error?


Hi All,

at least I got it working without the error from last post.
The reason for this Error is PI4J library. It's build, as we all know, for Raspberry. I used Eclipse on a Windows machine to write and build my Java software. I was using the lib from And I exportet my Java software as runnable Jar with the option "Package required libraries into generated JAR" and as well "Extract required libraries into genreated JAR". So far so good. Would be comfortable, if there is not small misstake a made. In the libs I used is wiringPi included. It's the wiringPi for Raspberry Pi. So this couldn't work.
I recompiled an exported the code with the option "Copy required libraries into a sub-folder next to the generated JAR". Ok, this works. The error from the last post is gone.
But it would not be my project if there isn't now another error.
Now I got an UndefinedClassException. My Software can't find class. I bearly can understand it. It's because the I'm using on my windows machine are not on my Banana Pi. But why they aren't there? I've installed pi4j an build it and so on ...
Can anybody tell me, how to get the correct libs on my Banana Pi? Or how to fix this new error another way?

Kind regards,

Hi Guys!

I am the founder of the Pi4J project and I just came across this thread.  I’m glad to see there is interest in using Java and Pi4J on the BananaPi.  

If there is still interest and some of you guys are able to help with testing and providing some insight to the changes needed, I would be happy to look into integrating some custom build options so Pi4J can be compiled directly for the BananaPi platform.  

I have just ordered a BananaPi so I can be better prepared for this platform.

Robert Savage

savageautomate replied at Sun Sep 13, 2015 18:52
Hi Guys!

I am the founder of the Pi4J project and I just came across this thread.  I’m glad to see ...

it`s awesome to see this.
i`m user of raspberry pi 2 and banana pro, on pi2 its works perfectly. i`m here to make testes and give some feedbacks.


Edited by savageautomate at Nov 20, 2015 13:55

Hello Fellow Bananians,

The Pi4J Project now includes support for BananaPi and BananaPro!   

This support has just been added and only cursory tests performed, so lets call it experimental for now, but I welcome you guys to try it out and let me know if you run into any trouble.  You must use the Pi4J v1.1-SNAPSHOT builds until v1.1 gets released.  You can manually download the JARs in ZIP or the installable .DEB package from this page:

Support includes Java programatic access and control of GPIO inputs/outputs, PWM, I2C, SPI, and UART (serial).

There is no documentation yet specifically for the Banana platforms, but apart from a few subtle differences in configuring a platform and pin/bus addressing, its basically the same.  Perhaps better than documentation .. there are a number of examples (sample code) included in the build and available in the GitHub repo specific to each Banana platform:

BananaPi Examples:

BananaPro Examples:

Other notes:  You don't have to install and compile WiringPi/WiringBP seperately!  The Pi4J core JAR includes all the native libraries it needs to communicate with the hardware embeded in the JAR.



savageautomate replied at Nov 20, 2015 13:52
Hello Fellow Bananians,

The Pi4J Project now includes support for BananaPi and BananaPro!   

Thats fantastic news!!!!
Thanks!!! Cant wait to try this, always nice to see people still working on banana pi

mcm handbags, air max 2014, nike roshe run, air jordan shoes, cheap oakley sunglasses, giuseppe zanotti sneakers, hogan mens shoes, coach black friday, mcm handbags, adidas shoes, jack wolfskin outlet online, air max, tory burch handbags, adidas superstar, miami heat, ralph lauren, soccer shoes, the north face, sacramento kings, cowboys jerseys, versace outlet, asics gel, ugg boots, pandora canada, under armour outlet, mont blanc pens, cheap jerseys, moncler mens jackets, polo ralph lauren, hilfiger online shop, michael kors v?skor, nfl jerseys, michael kors outlet online sale, designer handbags, airmax, dre beats,, denver nuggets jerseys, burberry outlet store,, ugg australia, dsquared2 outlet, suns jersey, hornets jersey, nike mercurial vapor, titans jerseys, bengals jerseys, reebok, chiefs jerseys, oakley sunglasses outlet, jimmy choo, coach outlet online, nike free 5.0, asics outlet, cheap basketball shoes, polo ralph, nike air max, nike tn, prada, relojes, burberry, mcm handbags, nike running shoes, north face backpacks, ray ban wayfarer, rolex, zapatillas nike, bcbg max, ray ban outlet, nike roshe run, north face jackets, nfl jerseys, air max 90, tommy hilfiger outlet, fidget spinner, dansko shoes outlet, northface, parajumpers parkas, dre headphones, eyeglasses stores, timberland boots, air jordan retro, michael kors uk, converse sneakers, rayban, cheap ray ban, ray-ban sunglasses, barbour jacket outlet,, oakley sunglasses, cavaliers jersey, ray ban wayfarer, coach outlet sale, michael kors handbags, michael kors outlet online, nike air max, ralph lauren polo, michael kors handbags, longchamp, washington wizards jersey, mizuno, ugg australia, nike schoenen, longchamp handbags, jets jerseys, gafas oakley, burberry sale, raiders jerseys, cheap nfl jerseys, nike free, oakley, toronto raptors jersey, adidas zx flux, michael jordan, ray ban occhiali, purses and handbags, true religion jeans men, air max 2014, polo ralph lauren, north face jackets, ralph lauren outlet online, kate spade handbags, vans shoes, rayban, true religion outlet, pandora charms, skechers womens shoes, nike air max thea, burberry online shop, nike store uk, juicy couture outlet, chi flat iron, vikings jerseys, patriots jerseys, belstaff jackets outlet, belstaff mens jackets, juicy couture, polo ralph lauren, kate spade, the north face outlet, swarovski, steelers jerseys, guess bags, fred perry outlet, polo outlet, cheap oakley sunglasses, adidas online shop, ralph lauren polo, north face, nba jerseys, kate spade bags, coach bags outlet, red bottom, adidas sneakers, minnesota timberwolves jersey, lac jersey, nike air huarache, beats by dre headphones, givenchy shoes outlet, true religion, skechers outlet , michael kors handbags, ferragamo shoes,

You have to log in before you can reply Login | Sign Up

Points Rules