關(guān)于Java使用Rxtx包操作串口記錄
教程網(wǎng)上都有扔傅,我記錄一個遇到的錯誤,卡在一個地方一天。
在使用flush方法和read方法時碰見如下報錯捺球,程序終止運(yùn)行:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180004465, pid=9864, tid=10460
#
# JRE version: Java(TM) SE Runtime Environment (11.0.4+10) (build 11.0.4+10-LTS)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C? [rxtxSerial.dll+0x4465]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Administrator\Desktop\project\java\ck\index\hs_err_pid9864.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.
#
原因好像是Rxtx包不支持高版本jdk,換成jdk8夕冲,解決