开源改变世界!!

树莓派、openjdk7的麻烦 #34

推推 grbl 2年前 (2023-01-25) 152次浏览
关闭
chuck-h 打开了这个问题 2012 年 12 月 19 日 · 4条评论
关闭

树莓派、openjdk7的麻烦#34

chuck-h 打开了这个问题 2012 年 12 月 19 日 · 4条评论

注释

树莓派、openjdk7的麻烦 #34

(我不是高级用户)

将通用 gcode 发送器 v1.0.5 全新下载到运行最新 debian wheezy 和 armh(硬件浮点)架构的 Raspberry Pi。下载并安装java:

pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
pi@raspberrypi ~ $ update-alternatives --display java
java - auto mode
  link currently points to /usr/lib/jvm/java-7-openjdk-armhf/jre/bin/java
/usr/lib/jvm/java-7-openjdk-armhf/jre/bin/java - priority 1063
  slave java.1.gz: /usr/lib/jvm/java-7-openjdk-armhf/jre/man/man1/java.1.gz
Current 'best' version is '/usr/lib/jvm/java-7-openjdk-armhf/jre/bin/java'.

通过 start.sh 运行应用程序给出了这个:

pi@raspberrypi ~/ose/steppernug $ ./start.sh
java.lang.UnsatisfiedLinkError: /tmp/rxtxSerial-8942054022052768266.so: /tmp/rxtxSerial-8942054022052768266.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /tmp/rxtxSerial-8942054022052768266.so: /tmp/rxtxSerial-8942054022052768266.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1935)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1860)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1834)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
    at com.willwinder.universalgcodesender.CommUtils.getSerialPortList(CommUtils.java:67)
    at com.willwinder.universalgcodesender.MainWindow.loadPortSelector(MainWindow.java:1295)
    at com.willwinder.universalgcodesender.MainWindow.initProgram(MainWindow.java:1105)
    at com.willwinder.universalgcodesender.MainWindow.<init>(MainWindow.java:62)
    at com.willwinder.universalgcodesender.MainWindow$25.run(MainWindow.java:1099)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

如果相关,我安装的 rxtxSerial 库位于

/usr/lib/jni/librxtxSerial.so

有什么建议么?

有人在 RPi 上成功运行过吗?

谢谢,
查克

树莓派、openjdk7的麻烦 #34
作者

仔细研究一下,我们似乎需要 Universal-G-Code-Sender/lib/natives 子目录中的另一个本机二进制文件,并且该uname -m字符串将区分 x86 和 armv6l 。

理想情况下,我会弄清楚 One-jar 是如何被告知如何管理它并构建一个新包的;然而,这看起来像是我要攀登的学习曲线。

与此同时,有人可以推荐一种方法来绕过 One-jar 并只使用我安装的 librxtxSerial.so 库吗?

谢谢

树莓派、openjdk7的麻烦 #34
所有者

我认为如果 One-Jar 版本不包含正确的版本,它应该可以选择任何本地安装。

尝试设置 RXTX 并查看它是否有效。

将 jar 文件添加到类路径:
export CLASSPATH=$CLASSPATH://RXTXcomm.jar

添加本机文件到库路径:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jni/librxtxSerial.so

这里有更多细节:http ://rxtx.qbang.org/wiki/index.php/Installation_on_Linux

树莓派、openjdk7的麻烦 #34
作者

没有喜悦…

pi@raspberrypi ~ $ echo $CLASSPATH
//RXTXcomm.jar
pi@raspberrypi ~ $ echo $LD_LIBRARY_PATH
/usr/lib/jni/librxtxSerial.so
pi@raspberrypi ~ $ java -jar UniversalGcodeSender-all32.jar 
java.lang.UnsatisfiedLinkError: /tmp/rxtxSerial-4662177016314051811.so: /tmp/rxtxSerial-4662177016314051811.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform) thrown while loading gnu.io.RXTXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /tmp/rxtxSerial-4662177016314051811.so: /tmp/rxtxSerial-4662177016314051811.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
       at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[...]

尽管如此,我还是以笨拙的 Java 新手方式下载并编译了 UniversalGCodeSender 源代码。在发出以下警告后,应用程序现在打开:

Stable Library
=========================================
Native lib Version = RXTX-2.2pre2
Java lib Version   = RXTX-2.1-7
WARNING:  RXTX Version mismatch
            Jar version = RXTX-2.1-7
            native lib Version = RXTX-2.2pre2

然后我从 rxtx.qbang.org 下载了当前的 RXTX-2.2 RXTXcomm.jar 并替换了 UniversalGCodeSender/lib 目录中的 RXTXcomm.jar。这将我的警告消息升级为

WARNING:  RXTX Version mismatch
        Jar version = RXTX-2.2pre1
        native lib Version = RXTX-2.2pre2

根据 rxtx.qbang.org/wiki/index.php/Download,这似乎是意料之中的。

这就是我今晚睡觉前要离开的地方。zzzzzzzzz

树莓派、openjdk7的麻烦 #34
作者

Raspberry Pi 上的通用 G 代码发送器:通过此处的解决方法成功解决:http: //opensourceecology.org/wiki/GcodeCommunications#Universal_G-code_Sender