java - 串口读取 - 错误 : EXCEPTION_ACCESS_VIOLATION - C [rxtxSerial. dll+0x5b00]

标签 java java-8 serial-port rxtx com-port

目前我正在尝试读取串口。在 Linux 中工作正常。但在 Windows 机器中面临错误。
我关注了这个 linkhere 读取串口和下载的 RXTX 库对于 Windows 机器(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.
#
建议对我有帮助。谢谢!

最佳答案

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 .

关于java - 串口读取 - 错误 : EXCEPTION_ACCESS_VIOLATION - C [rxtxSerial. dll+0x5b00],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63157940/

相关文章:

java - 为什么 JavaFX 中的绑定(bind)会以它们的方式工作?

java - 计算法线

java - 如何在 Java 8 中将 Map<String, List<String>> 转换为 Map<String, String>

c# - WaitFor() - 如何等待特定缓冲区到达 Steam/SerialPort?

c++ - Windows 和 Linux 中 USB 串口的区别

java - 使用 if 语句更改图像

Java将8601格式的字符串解析为更具可读性的日期解析错误

Java 8 : method reference to a static method in a non-static way

条件添加 Optional<T> 的 Java List<T>

java - “java.lang.UnsupportedOperationException: Not supported yet.”