我目前正在尝试打开一个串行端口以向芯片发送一些数据,但我收到错误消息,java运行时环境已检测到致命错误。这是控制台日志。
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=21920, tid=23116
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (14.0.2+12) (build 14.0.2+12)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
导致错误的函数应该打开后端/板通信端口。这是函数
public boolean openPort() throws SerialPortException {
if(portOpened){
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_ALREADY_OPENED);
}
if(portName != null){
boolean useTIOCEXCL = (System.getProperty(SerialNativeInterface.PROPERTY_JSSC_NO_TIOCEXCL) == null &&
System.getProperty(SerialNativeInterface.PROPERTY_JSSC_NO_TIOCEXCL.toLowerCase()) == null);
portHandle = serialInterface.openPort(portName, useTIOCEXCL);//since 2.3.0 -> (if JSSC_NO_TIOCEXCL defined, exclusive lock for serial port will be disabled)
}
else {
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_NULL_NOT_PERMITTED);//since 2.1.0 -> NULL port name fix
}
if(portHandle == SerialNativeInterface.ERR_PORT_BUSY){
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_BUSY);
}
else if(portHandle == SerialNativeInterface.ERR_PORT_NOT_FOUND){
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_NOT_FOUND);
}
else if(portHandle == SerialNativeInterface.ERR_PERMISSION_DENIED){
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PERMISSION_DENIED);
}
else if(portHandle == SerialNativeInterface.ERR_INCORRECT_SERIAL_PORT){
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_INCORRECT_SERIAL_PORT);
}
portOpened = true;
return true;
}
任何有关如何解决此问题的想法将不胜感激!
附言这是我的第一篇文章,因此如果您有时间,也将不胜感激关于文章格式的反馈
谢谢 马布尔