raspbian java

183 views
Skip to first unread message

Γεώργιος Μεταξάκης

unread,
May 30, 2013, 4:13:39 AM5/30/13
to bluecove-...@googlegroups.com
Hello, i am trying to run a java program using bluecove library in raspbian dist of debian.

I followed this guide stackoverflow how to compile the bluecove library and it compiled well.

Now I am trying to run my program and I getting the error Bluecove com.intel.bluetooth.BluetoothStackBluez not available, in all the topics I read the saying that the problem is the classpath but I run like this java -cp lib/bluecove-gpl-2.1.0.jar:lib/bluecove-2.1.0.jar -jar myApp.jar

Any suggestion?

Mina Shokry

unread,
May 30, 2013, 4:37:20 AM5/30/13
to Bluecove Emails
Hi,

I reviewed bluecove code and the only possibility I can say is that it is a classpath problem although your command line looks fine. All what I can suggest you do is to debug this on your platform and see what is going wrong.
Start from method BluecoveImpl.detectStack() and look specifically at method BluecoveImpl.loadStackClass(). This last method is what throws the exception you are encountering when it fails to load the bluetooth stack class.

Good luck.


--
--
You received this message because you are subscribed to the Google
Groups "bluecove-developers" group.
For more options, visit this group at
http://groups.google.com/group/bluecove-developers
---
You received this message because you are subscribed to the Google Groups "bluecove-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-develo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Γεώργιος Μεταξάκης

unread,
May 30, 2013, 5:09:33 AM5/30/13
to bluecove-...@googlegroups.com
before I see your comment, I tried something else, I donwload again the source for bluecove but now from here and I compile it, I tried to use these jars and now the error is about BluetoothStackBlueZDBus, maybe the problem is the source I using to compile bluecove.jar ?

To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-developers+unsub...@googlegroups.com.

Mina Shokry

unread,
May 30, 2013, 5:18:16 AM5/30/13
to Bluecove Emails
I am not sure what version is the code you used before, but I believe the distinction between the bluez stack and the d-bus stack was added from a long time. Again, as you are already building bluecove from source, try adding some logging messages or connect a debugger and see what is going on. This is what I would do if I am sure the classpath is ok. But I still believe it is a classpath issue. Your problem is simply that bluecove isn't able to load the stack class.


To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-develo...@googlegroups.com.

Γεώργιος Μεταξάκης

unread,
May 30, 2013, 5:36:39 AM5/30/13
to bluecove-...@googlegroups.com
first I used bluecove-2.1.0 downloaded from here

and to add 
if I run without -cp the error is NoClassDefFoundError: javax/bluetooth/LocalDevice

On Thursday, May 30, 2013 12:18:16 PM UTC+3, Mina Shokry wrote:
I am not sure what version is the code you used before, but I believe the distinction between the bluez stack and the d-bus stack was added from a long time. Again, as you are already building bluecove from source, try adding some logging messages or connect a debugger and see what is going on. This is what I would do if I am sure the classpath is ok. But I still believe it is a classpath issue. Your problem is simply that bluecove isn't able to load the stack class.
On Thu, May 30, 2013 at 2:09 AM, Γεώργιος Μεταξάκης <meta...@gmail.com> wrote:
before I see your comment, I tried something else, I donwload again the source for bluecove but now from here and I compile it, I tried to use these jars and now the error is about BluetoothStackBlueZDBus, maybe the problem is the source I using to compile bluecove.jar ?

from the site I get the bluecove-2.1.1-SNAPSHOT.jar and 
bluecove-gpl-2.1.1-SNAPSHOT-sources.tar.gz

On Thursday, May 30, 2013 11:37:20 AM UTC+3, Mina Shokry wrote:
Hi,

I reviewed bluecove code and the only possibility I can say is that it is a classpath problem although your command line looks fine. All what I can suggest you do is to debug this on your platform and see what is going wrong.
Start from method BluecoveImpl.detectStack() and look specifically at method BluecoveImpl.loadStackClass(). This last method is what throws the exception you are encountering when it fails to load the bluetooth stack class.

Good luck.
On Thu, May 30, 2013 at 1:13 AM, Γεώργιος Μεταξάκης <meta...@gmail.com> wrote:
Hello, i am trying to run a java program using bluecove library in raspbian dist of debian.

I followed this guide stackoverflow how to compile the bluecove library and it compiled well.

Now I am trying to run my program and I getting the error Bluecove com.intel.bluetooth.BluetoothStackBluez not available, in all the topics I read the saying that the problem is the classpath but I run like this java -cp lib/bluecove-gpl-2.1.0.jar:lib/bluecove-2.1.0.jar -jar myApp.jar

Any suggestion?

--
--
You received this message because you are subscribed to the Google
Groups "bluecove-developers" group.
For more options, visit this group at
http://groups.google.com/group/bluecove-developers
---
You received this message because you are subscribed to the Google Groups "bluecove-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-developers+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mina Shokry

unread,
May 30, 2013, 5:56:20 AM5/30/13
to Bluecove Emails
This is obvious.

A NoClassDefFoundError is thrown when a class existed at compile time but was not found at runtime which is the case when you compile your classes that import the the javax.bluetooth.LocalDevice class and remove it from runtime classpath.
On the other side when a class is tried to be loaded dynamically at runtime but not found, a ClassNotFoundException is thrown and this is caught by bluecove internal code and converted to a BluetothStateException which I guess is your case.


To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-develo...@googlegroups.com.

Γεώργιος Μεταξάκης

unread,
May 30, 2013, 6:29:13 AM5/30/13
to bluecove-...@googlegroups.com
so you saying that it can see the bluecove but also it can't ?
it can be problem that the project has been compiled(not from me) with the bluecove for windows?

Mina Shokry

unread,
May 30, 2013, 6:59:34 AM5/30/13
to Bluecove Emails
Well, the class LocalDevice is in bluecove.jar while the class BluetoothStackBluez is in bluecove-gpl.jar. your problem looks like that only bluecove.jar is in classpath.


To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-develo...@googlegroups.com.

Γεώργιος Μεταξάκης

unread,
May 30, 2013, 7:32:42 AM5/30/13
to bluecove-...@googlegroups.com
i copied the project to my windowsPC and it works with the bluecove compiled for linux, is that appropriate ?
i can't see any bluetoothstackbluezdbus error in windowsPC

Mina Shokry

unread,
May 30, 2013, 1:46:14 PM5/30/13
to Bluecove Emails
Bluecove is built with portability in mind. The same jar can run on different platforms as long as appropriate native libraries exist and they are packaged inside the bluecove jar so that just copying the jar is enough.

Because of a license issue, bluecove module for linux is distributed as a separate jar which is bluecove-gpl. Having only bluecove.jar and not bluecove-gpl.jar in your classpath will make your code run on windows because the native library exists inside bluecove.jar and does not run on linux because bluecove-gpl.jar isn't.

Again, your problem seems to be that bluecove-gpl isn't correctly included in your classpath.

It may be an issue in the java implementation on your platform. I don't have any clues about the raspberry platform.


To unsubscribe from this group and stop receiving emails from it, send an email to bluecove-develo...@googlegroups.com.

Γεώργιος Μεταξάκης

unread,
May 31, 2013, 3:34:00 AM5/31/13
to bluecove-...@googlegroups.com
as I read to another website the problem is really the classpath, somehow java ignores the -cp or -classpath and I have to compile manual the stack libraries to include them.

Γεώργιος Μεταξάκης

unread,
May 31, 2013, 6:36:12 AM5/31/13
to bluecove-...@googlegroups.com
it didn't work, are you have any idea what to do to java to see the classpath?
now i have a folder with the bluetoothstackbluez.class

Ricardo JL Rufino

unread,
Oct 11, 2014, 1:12:52 PM10/11/14
to bluecove-...@googlegroups.com, meta...@gmail.com
Leaving a solution for those who need:

- Quick guide to compile BlueCove in Raspberry

Hunter Hancock

unread,
Jul 17, 2021, 2:01:36 PM7/17/21
to bluecove-developers
I just had a painful time trying to get bluecove to compile with Java 11, but I did finally manage to do it. I'll go ahead and share my compiled .so file (tested working with Java 11 on both the RPi 3b+ & RPi0W). Hopefully this will help anyone else who's looking for that ARM binary.

Reply all
Reply to author
Forward
0 new messages