简体   繁体   English

Java Windows x64 中的串行 I/O 使用 JRE x86

[英]Java Serial I/O in Windows x64 using JRE x86

I have a Java application running on Windows 7 64-bit, but running on a 32-bit version of JRE.我有一个 Java 应用程序在 Windows 7 64 位上运行,但在 32 位版本的 JRE 上运行。 I need this application to communicate with a serial com port, and apparently I need a little help.我需要这个应用程序与串行 com 端口通信,显然我需要一点帮助。 :) :)

Before you suggest RXTX, I've already tried it, both with 32- and 64-bit versions of the RXTX DLLs.在您建议 RXTX 之前,我已经尝试过 32 位和 64 位版本的 RXTX DLL。 Either it fails because 32-bit JRE can't load a 64-bit DLL, or it fails because the 32-bit DLL gives an java.lang.UnsatisfiedLinkError:它失败是因为 32 位 JRE 无法加载 64 位 DLL,或者它失败是因为 32 位 DLL 给出了 Z93F725A07423FE1C889F448B33D2FiLinkedError4。

java.lang.UnsatisfiedLinkError: <Path>\cache\bundle1030\version0.0\bundle.jar-lib\0\lib\win32\rxtxSerial.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)

which I assume is because the 32-bit RXTX DLL can't find a 32-bit DLL in Windows to use for serial communication.我认为这是因为 32 位 RXTX DLL 在 Windows 中找不到用于串行通信的 32 位 DLL。

Any clues for how to proceed?有关如何进行的任何线索? Another library?另一个图书馆? How to bridge the gap between 32-bit JRE and 64-bit Windows DLLs?如何弥合 32 位 JRE 和 64 位 Windows DLL 之间的差距?

There is an amazing free tool called Dependency Walker .有一个很棒的免费工具,叫做Dependency Walker It tells you precisely what other DLLs a given DLL will load based on the current PATH, and which ones can't be found, or won't load correctly.它准确地告诉您给定 DLL 将根据当前 PATH 加载哪些其他 DLL,以及哪些无法找到或无法正确加载。 It has saved my bacon many times, and it should be the perfect tool for debugging your problem here.它已经救了我很多次了,它应该是在这里调试你的问题的完美工具。 Once you know what's missing you may be able to find 32-bit versions to install -- or maybe just alter your path to make them available.一旦您知道缺少什么,您就可以找到要安装的 32 位版本——或者只是改变您的路径以使它们可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM