Native bluecove_arm library unavailable

I am trying to compile / run a program that uses BlueCove libraries on BeagleBone Black running Ubuntu. However, I keep getting this error on startup:

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 that this is not a problem with the code, since I can run the code with the BlueCove libraries on a 64-bit Linux computer running Mint (which is based on Ubuntu). I searched the Internet for several solutions and cannot find the 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 tried to compile / run the code both through the terminal and into the NetBeans IDE.

Is there another step I need to take to make this work? Why does he keep saying that the Bluecove library is unavailable even after I recompiled it for ARM?

+6
source share
2 answers

This is for future reference for those coming up with this question:

Mark the answer provided by MyRevel on top of the raspberry pi forum. It worked like a charm!:)

For the sake of spreading a working solution that is easy to track, and because this question is the first result that appears on google, I retell the steps from the answer above (I made some minor changes, 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 RPi using terminal or SSH:

Create a compilation space 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` 

The temp folder now contains two folders: bluecove-gpl-2.1.0 and bluecove.

Edit build.xml file:

 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 the bluetooth packages and packages necessary 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 the 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 

Compilation start:

 cd ~/temp/bluecove-gpl-2.1.0 ant all 

Upon successful compilation, 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 bluecove-gpl-2.1.0.jar along with the downloaded bluecove-2.1.0.jar to the java path library directory for your java development program.

Running your Java program using the bluecove libraries can be done as follows:

 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 are separated by a colon (:).

In this case, we want to include MyJavaProgram.jar and all the files in the bluecove_libs directory.

The last parameter tells java from which the package and the main () class should be executed.

Note that /path/to/bluecove_libs/ will contain the following files:

  • bluecove-gpl-2.1.0.jar → the file we compiled above
  • bluecove-2.1.0.jar file downloaded from the Internet
+3
source

O "Is there another step I need to take to make this work? Why does he continue to say that the Bluecove library is unavailable even after I recompiled it for ARM?"

I found the same problem when I tried to compile Ubuntu. The reason was in the gcc compiler. It has different default settings for different versions.

I had to make the following change in the build.xml file for bluecove-gpl-2.1.1-SNAPSHOT.jar

1) <property name = "bluecove.native.linker.options" value = "- nodefaultlibs" / ">

=>

<property name = "bluecove.native.linker.options" value = "/">

2) <arg value = "- Wl, -soname, libbluecove $ {library_sufix} - $ {product_version}" / ">

=>

<arg value = "- Wl, -no-as-needed, -soname, libbluecove $ {library_sufix} - $ {product_version}" / ">

3) <arg value = "- L $ {libs-universal}" / ">

<arg value = "- lbluetooth" / ">

<arg line => $ {bluecove.native.linker.options} "/">

<arg value = "- Wl, -soname, libbluecove $ {library_sufix} - $ {product_version}" / ">

=>

<arg value = "- L $ {libs-universal}" / ">

<arg line => $ {bluecove.native.linker.options} "/">

<arg value = "- Wl, -no-as-needed, -soname, libbluecove $ {library_sufix} - $ {Product_version}" / ">

<arg value = "- lbluetooth" / ">

http://privateblog.info/raspberry-pi-kak-rabotat-s-bluetooth-na-java/

0
source

All Articles