I am building a JAVA desktop app that can advertise via BLE to nearby android devices.
I stumbled across BlueCove which seems to be Java's bluetooth API.
Whenever I try to use BlueCove in my Java application on my MacBook Pro M1, I am getting the following error:
Native Library bluecove not available
Exception in thread "main" 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:434)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:65)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1020)
at java.base/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)
I found online that you need to use the -d32
parameter when launching your java application. I tried that but I get a Unrecognized option: -d32
. Answers like these say that there is an unreleased version 2.1.2 which works on a Mac but the link you can find online seems to be broken.
Was anyone able to have BlueCove (or any Java Bluetooth API) working in their Java application?