我正在开发 JavaFX 8 应用程序,用于通过 Windows 虚拟 Com-Port 与物理设备进行通信。
- Windows 7/10 64 位
- IDE Eclipse Mars
- Ant
- InnoSetup 5.5.6
- jdk 1.8.0_121
- jssc 2.7.0 - 用于串口通信
我正在使用 Ant 和 InnoSetup 构建 native 安装程序。安装后,可以通过 Windows 7 和 10 上的 native 启动器 (App.exe) 启动该应用程序。
在 Windows 7 上,我可以打开 Com-Port,并且应用程序运行良好。
当我尝试在 Windows 10 上打开 Com 端口时,jvm 崩溃并显示以下消息:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006ec4b5bb, pid=1632, tid=0x0000000000001898
#
# JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [jSSC-2.7_x86_64.dll+0xb5bb]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# 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.
#
通过双击 App.jar 而不是 App.exe 启动应用程序时,可以在 Windows 10 上打开虚拟 Com 端口。
native 启动器 (App.exe) 和 jar (App.jar) 都使用系统 jre。
如何才能使应用程序(由 App.exe 启动)在两个平台上运行?
请帮忙!
最佳答案
崩溃似乎发生在 jSSC-2.7_x86_64.dll 文件内的 native 代码“C [jSSC-2.7_x86_64.dll+0xb5bb]”中,这可能是由于该库如何调用 api,检查你的程序。 EXCEPTION_ACCESS_VIOLATION 表示您的代码尝试访问它没有读取权限的内存位置 (0xc0000005)
由于程序在Windows 7上运行正常,请检查Windows 10兼容的串口驱动程序。崩溃可能是由于驱动程序不匹配造成的
关于JavaFX Windows 10 native bundle 部署 - 异常访问冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42679430/