我在运行 debian wheezy 的树莓派上的 Java 蓝牙服务器需要 bluecove 本机库 - 我在哪里可以找到它?

2022-01-24 00:00:00 raspberry-pi debian bluetooth java bluecove

我有一个在 Windows 机器上运行的 Java 蓝牙服务器,我想将它移植到 Raspberry pi.我在 Java 方面有很多经验,但在蓝牙或 Linux 方面却很少.

I have a Java bluetooth server running on a Windows box which I want to port to the Raspberry pi. I have lots of experience with Java but little with Bluetooth or Linux.

pi 目前有 Debian Wheezy 操作系统,我已经安装了蓝牙和 Java ok,并将 bluecove-gpl 和 bluecove jar 放在类路径中.

The pi currently has Debian Wheezy operating system and I've installed bluetooth and Java ok, and placed the bluecove-gpl and bluecove jars in the classpath.

但是,当我尝试运行服务器时,Java 会报错

When I try to run the server, however, Java complains

本机库 bluecove_arm 不可用.

Native library bluecove_arm not available.

我尝试从 gpl jar 重命名 libbluecove_arm.so 没有成功,即使将 -Dbluecove.native.path 设置为指向它.

I've tried renaming libbluecove_arm.so from the gpl jar without success, even when setting -Dbluecove.native.path to point to it.

有谁知道在哪里可以找到正确的库、应该调用什么以及应该放置在哪里?

Does anyone know where to find the correct library, what it should be called, and where it should be placed?

[已解决}

在 google 代码站点上找到了一个 sh 构建脚本,它展示了如何编译 java 源文件、生成 jni 头文件、编译和链接 c 文件以生成 so 库文件.唯一的问题是库文件需要重命名为 libbluecove_arm.so 才能找到.全部在 pi 上完成!

Found a sh build script on the google code site which showed how to compile the java source files, generate jni headers, compile and link the c files to produce a so library file. Only hiccup was that the library file needed then to be renamed libbluecove_arm.so before it would be found. All done on the pi!

推荐答案

mkdir bluecovelib

cd bluecovelib

wget http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.63/bluecove-gpl-2.1.1-SNAPSHOT-sources.tar.gz

tar -zxvf bluecove-gpl-2.1.1-SNAPSHOT-sources.tar.gz

mkdir -p bluecove/target

cd bluecove/target

wget http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.63/bluecove-2.1.1-SNAPSHOT.jar

cd ../../bluecove-gpl-2.1.1-SNAPSHOT
ant all

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

相关文章