File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide 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

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>(
at WRLImpl.main(
Caused by: javax.bluetooth.BluetoothStateException: BlueCove library bluecove not available
at Method)
at javax.bluetooth.LocalDevice.getLocalDeviceInstance(
at javax.bluetooth.LocalDevice.getLocalDevice(
at wiiremotej.WiiRemoteJ.<clinit>(
... 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

Joined: May 03, 2008
Posts: 5115

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 ${}/bluecove_${}_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:
subject: How to use bluetooth on a mac
It's not a secret anymore!