5

目前我正在尝试读取串口。在 Linux 中工作正常。但在 Windows 机器中面临错误。

我按照此链接此处为 Windows 机器读取串行端口和下载的 RXTX 库(JAR + DLL 文件)。

操作系统:Windows 10 64 位

Java jre:Jre 1.8.0_261 版本。

通过输入流读取时抛出异常。

错误日志:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180005b00, pid=4508, tid=0x0000000000002b90
#
# JRE version: Java(TM) SE Runtime Environment (8.0_261-b12) (build 1.8.0_261-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.261-b12 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [rxtxSerial.dll+0x5b00]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\user1\eclipse-workspace\serialport\hs_err_pid4508.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

建议对我有帮助。谢谢!

4

4 回答 4

3

TL;DR:不要使用 1.8.0_261 而是使用 1.8.0_251

我尝试使用 Windows 10.0、64 位 Build 18362 (10.0.18362.1082) 在 1.8.0_181、1.8.0_251 和 1.8.0_261 中重现此错误。

我只能用 Jre 1.8.0_261 重现这个错误。u181 和 u251 对我来说很好用。我建议使用https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html中的 java 8 u251 。

于 2020-09-30T10:37:42.473 回答
1

从 1.8.0_241 到 1.8.0_271 的 java 更新后,我正在处理的应用程序的串行端口今天失败了。我认为问题可能是从 Visual Studio 2010 切换到现在构建 Java 8 的 2017。

新的功能:

➜ JDK/JRE 运行时 Windows Visual Studio 库 (DLL) 依赖更改

Java 1.8.0_261 发行说明

更新:我使用的是jssc(Java Simple Serial Connector)的一个相当旧的版本(2017 ) 。不幸的是,原版已经有一段时间没有更新了。但我 在 GitHub 上找到了一个 fork,它继续开发。有了分叉版本,我就没有其他问题了!

于 2021-01-22T13:54:27.833 回答
0

至于我,1.8.0_261 与 RXTX 完美配合,但在 1.8.0_271 上崩溃。我正在使用:Jar 版本:RXTX-2.2pre1 本机库版本:RXTX-2.2pre2

于 2021-01-08T08:49:56.740 回答
0

我使用 2021 年 1 月 19 日更新的 Java 8u281 版本测试了 RXTX,但它也崩溃了。

但是 AdoptOpenJDK 8u282 运行顺利,使用 RXTX 进行串行通信没有任何错误,并且看起来与 Oracle JDK 完全兼容!!!采用OpenJDK

于 2021-02-10T07:41:37.187 回答