I am trying to compile/run a program that uses the BlueCove libraries on a BeagleBone Black running Ubuntu. However I keep getting this error when running:
Native Library bluecove_arm not available
javax.bluetooth.BluetoothStateException: BlueCove library bluecove not available
at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:381)
at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:429)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:65)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1020)
at java.security.AccessController.doPrivileged(Native Method)
at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1018)
at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1011)
at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at edit.rit.ce.whud.DataServer.bluetoothHandler(DataServer.java:16)
at edit.rit.ce.whud.GUI.main(GUI.java:153)
I know this isn't an issue with the code, since I can run the code with the BlueCove libraries on a x64 bit Linux computer running Mint (which is based off Ubuntu). I have searched online for several solutions and can't find one that solves my problem. I have already recompiled the bluecove-gpl-2.1.0 libraries for ARM using this method
http://www.raspberrypi.org/forums/viewtopic.php?f=81&t=58758
and have tried compiling/running the code both through the terminal and NetBeans IDE.
Is there some other step I need to do to make this work? Why does it keep saying Bluecove library isn't available even after I recompiled it for ARM?
This is for future reference for anyone coming upon this question:
Check out the answer provided by MyRevel over on the raspberry pi forums. It worked like a charm! :)
For the sake of spreading a working solution thats easy to follow, and because this question is the first result that appears in google, I am reposting the steps from the answer mentioned above (I've made some slight modifications but the effect is the same):
Download bluecove-2.1.0.jar
and bluecove-gpl-2.1.0-sources.tar.gz
from http://code.google.com/p/bluecove/downloads/list or http://sourceforge.net/projects/bluecove/files/BlueCove/2.1.0/.
On the RPi, using the terminal or SSH:
Create a place to do the compilation and extract the source files:
`mkdir -p ~/temp/bluecove/target/`
`cd ~/temp`
`tar xf bluecove-gpl-2.1.0-sources.tar.gz`
`mv ~/Downloads/bluecove-2.1.0.jar ~/temp/bluecove/target/bluecove-2.1.0.jar`
Now folder temp includes two folders: bluecove-gpl-2.1.0 and bluecove.
Modify build.xml:
nano ~/temp/bluecove-gpl-2.1.0/build.xml
Delete text '-SNAPSHOT' on line 12 of build.xml:
from: <property name="product_version" value="2.1.0-SNAPSHOT"/>
to: <property name="product_version" value="2.1.0"/>
Save file: `Ctrl+X` then `Y` and `Enter`.
Install bluetooth packages and packages required for compilation:
sudo apt-get update && apt-get upgrade && apt-get autoremove
sudo apt-get install bluetooth bluez-utils blueman
sudo apt-get install libbluetooth-dev # BlueZ development package needed for compilation later
sudo apt-get install ant
Connect Bluetooth dongle and test if Bluetooth OK:
/etc/init.d/bluetooth status # check to see whether the bluetooth is live
hcitool scan # show any devices in range of the dongle
sudo service bluetooth start # start the bluetooth service if required
Start compilation:
cd ~/temp/bluecove-gpl-2.1.0
ant all
When successfully compiled you can find the required gpl jar in:
~/temp/bluecove-gpl-2.1.0/target/bluecove-gpl-2.1.0.jar
Finally...
Move the generated file, bluecove-gpl-2.1.0.jar
, together with the downloaded file, bluecove-2.1.0.jar
, into your java build path libraries directory of your java development program.
Running your java program with the bluecove libraries can be done like so:
java -cp /path/to/MyJavaProgram.jar:/path/to/bluecove_libs/ myjavaprogram.MyJavaProgram
The -cp
switch allows us to specify a list of files and directories to include. Each directory and file is delimited with a colon (:).
In this case we are wanting to include MyJavaProgram.jar
, and all the files in the bluecove_libs
directory.
The final parameter tells java which package and class main() should be executed from.
Note that /path/to/bluecove_libs/
will contain the following files:
bluecove-gpl-2.1.0.jar
-> the file we compiled abovebluecove-2.1.0.jar
-> the file we downloaded from the webIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With