This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to use bluetooth on a mac Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to use bluetooth on a mac" Watch "How to use bluetooth on a mac" New topic
Author

How to use bluetooth on a mac

Len Padson
Ranch Hand

Joined: Nov 21, 2011
Posts: 40
Hello! I have spent hours googling for answers, but to no avail, so I'm turning to you all. I found an API called WiiRemoteJ, that allows a wiimote (The Controller of a Wii) to be connected to a computer and communicated with. (responding to button presses and accelrometer readings and such)

Anyway, the API requires, of course, java to be able to use bluetooth, and I have no experience in bluetooth. After realizing that my mac jdk did not already have the javax.bluetooth package, i downloaded it. Then I downloaded BlueCove. And now I am unsure of how to proceed.

When I run a sample file that came with the API, I get the following error:


Native Library bluecove not available
java.lang.IllegalStateException: Bluetooth failed to initialize. There is probably a problem with your local Bluetooth stack or API.
at wiiremotej.WiiRemoteJ.<clinit>(WiiRemoteJ.java:56)
at WRLImpl.main(WRLImpl.java:47)
Caused by: 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.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 wiiremotej.WiiRemoteJ.<clinit>(WiiRemoteJ.java:49)
... 1 more



I'm not sure what it means by "Native Library bluecove not available". Could somebody please tell me what this means, and suggestions as to how to fix it? Thank you in advance; I am very excited at the prospect of communicating with a Wiimote in my programs, and I really do not want to let this setback stop me!
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Have you gone through the "Native Library location" section in the BlueCove documentation? Does it help?


luck, db
There are no new questions, but there may be new answers.
Len Padson
Ranch Hand

Joined: Nov 21, 2011
Posts: 40
I am not really sure what it means. Maybe you or somebody else could help me?

This is on the BlueCove website:

Native Library location

By default Native Library is extracted from from jar to temporary directory ${java.io.tmpdir}/bluecove_${user.name}_N and loaded from this location.
If you wish to load library (.dll) from another location add this system property -Dbluecove.native.path=/your/path.
If you wish to load library from default location in path e.g. %SystemRoot%\system32 or any other location in %PATH% use -Dbluecove.native.resource=false


I feel like this implies that it should find the native library automatically, but obviously it isn't.

This is the instructions page if anybody would be so kind as to look and help me out. I've googled everything I can think of! And furthermore, I downloaded a program (nonjava) that can communicate with the wiimote and it works just fine, so i know this is possible. But that program did not use java. I would like to be able to make my own programs. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use bluetooth on a mac