本文介绍了在我的Raspberry中安装rxtx捆绑包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Raspberry Pi上安装rxtx捆绑包该捆绑包将在KURA平台上运行(Equinox是Kura的OSGi容器)

I want to install an rxtx bundle on my Raspberry Pithe bundle will be running on KURA platform (Equinox is the OSGi container for Kura)

我使用以下命令安装了rxtx本机库:sudo apt-get install librxtx-java

I installed the rxtx native library using:sudo apt-get install librxtx-java

.so已安装在以下目录中:/usr/lib/jni/

the .so was installed on the directory: /usr/lib/jni/

pi@raspberrypi /usr/lib/jni $ ls
librxtxI2C-2.2pre1.so       librxtxParallel.so     librxtxRS485-2.2pre1.so  librxtxSerial-2.2pre1.so
librxtxI2C.so               librxtxRaw-2.2pre1.so  librxtxRS485.so          librxtxSerial.so
librxtxParallel-2.2pre1.so  librxtxRaw.so  

然后,我按照此链接将rxtx库包装为一个包 http://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin

Then I followed this link to wrappe the rxtx library in a bundlehttp://rxtx.qbang.org/wiki/index.php/Wrapping_RXTX_in_an_Eclipse_Plugin

我添加到捆绑包中的清单是这样的:

I added to the bundle manifest this:

Bundle-NativeCode: /usr/lib/jni/librxtxSerial.so;osname="Linux";processor="armv6l"

因为我的操作系统类型是linux,我的体系结构是ARM:

cause my os type is linux, my architecture is ARM:

pi@raspberrypi ~ $ cat /proc/sys/kernel/{ostype,osrelease,version}
Linux
3.18.11+
#781 PREEMPT Tue Apr 21 18:02:18 BST 2015

pi@raspberrypi ~ $ arch
armv6l

但仍然无法安装捆绑软件,但出现此错误:

But still I can't install the bundle, I got this error:

!ENTRY  1 0 2015-06-19 10:19:40.982
!MESSAGE [IAgent][RemoteBundleAdminImpl@17f36b1] [startBundle] Bundle cannot be started: Error[code=-6000;message=Failed to start bundle: The bundle "RXTX_Bundle_1.0.0 [77]" could not be resolved. Reason: No match found for native code: /usr/lib/jni/librxtxSerial.so; processor=armv6l; osname=Linux;details=null]
!STACK 0
org.osgi.framework.BundleException: The bundle "RXTX_Bundle_1.0.0 [77]" could not be resolved. Reason: No match found for native code: /usr/lib/jni/librxtxSerial.so; processor=armv6l; osname=Linux
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
        at org.tigris.mtoolkit.iagent.internal.rpc.RemoteBundleAdminImpl.startBundle(RemoteBundleAdminImpl.java:230)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.tigris.mtoolkit.iagent.internal.pmp.InvocationThread.run(InvocationThread.java:54)
        at org.tigris.mtoolkit.iagent.internal.utils.ThreadPool$Worker.run(ThreadPool.java:179)
        at java.lang.Thread.run(Thread.java:724)

我做错了什么?非常感谢您的帮助!

What have I did wrong?Thanks a lot for your help!

更新在遵循@Jorge Martinez的建议之后:这是清单的我更新的行:

Updates after following @Jorge Martinez suggestion:here is my updated line of the manifest:

Bundle-NativeCode: nativelib/librxtxSerial.so;osname="Linux";processor="armv6l"

这是我的rxtx捆绑包的内容列表:

here is the list of content of my rxtx bundle:

推荐答案

豪尔赫的回答是正确的.您是否已物理检查了Eclipse创建的捆绑软件以确认您的nativelib目录存在?从Eclipse导出捆绑软件时,必须确保指定在构建中包括哪些文件夹和文件.这是通过打开build.properties文件并在要包括的文件夹/文件旁打上复选标记来完成的.

Jorge's response is correct. Have you physically examined the bundle being created by Eclipse to confirm your nativelib directory is present? When exporting the bundle from Eclipse, you have to ensure you specify which folders and files are included in the build. This is done by opening the build.properties file and placing a check mark by the folder/files you wish to include.

这篇关于在我的Raspberry中安装rxtx捆绑包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 09:16