目前我正在尝试读取串口。在 Linux 中工作正常。但在 Windows 机器中面临错误。
我按照此链接从此处为 Windows 机器(JAR + DLL 文件)读取串行端口和下载的 RXTX 库。
操作系统: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 …
Run Code Online (Sandbox Code Playgroud) 日志中的错误:
* 由于未捕获的异常“NSRangeException”而终止应用程序,原因:“* -[ NSArray0 objectAtIndex:]:索引 2 超出空 NSArray 的范围”*** 第一个抛出调用堆栈:( 0 CoreFoundation 0x000000010fdd8b0b __exceptionPreprocess + 171 1 libobjc.A. dylib 0x00000001143a6141 objc_exception_throw + 48 2 CoreFoundation 0x000000010fdf027d -[__NSArray0 objectAtIndex:] + 93 3 DropInn 0x000000010d598fc4 _TFC7DropInn21ListingViewController9tableViewfTCSo11UITableView 14didSelectRowAtV10Foundation9IndexPath_T_ + 5972 4 DropInn 0x000000010d599837 _TToFC7DropInn21ListingViewController9tableViewfTCSo11UITableView14didSelectRowAtV10Foundation9IndexPath_T_ + 87 5 UIKit 0x00000001122b3dcd -[UI TableView _selectRowAtIndexPath:动画:scrollPosition:notifyDelegate:] + 1763 6 UIKit 0x00000001122b3fe3 -[ UITableView _userSelectRowAtPendingSelectionIndexPath:] + 344 7 UIKit 0x00000001121697f3 _runAfterCACommitDeferredBlocks + 318 8 UIKit 0x00000001121567bc _cleanUpAfterCAFlushAndRunDeferredBlocks + 532 9 UIKit 0x000000011218828c _afterCACommitHandler + 137 10 CoreFoundation …