当前位置: 代码迷 >> 综合 >> JDK/JAVA Exception NSWindow drag regions should only be invalidated on the Main Thread
  详细解决方案

JDK/JAVA Exception NSWindow drag regions should only be invalidated on the Main Thread

热度:94   发布时间:2023-12-11 17:22:35.0
  • 在MAC 11上运行jogmap,报错:
2022-01-24 10:56:37.395 java[94984:1325231] Apple AWT Internal Exception: NSWindow drag regions should only be invalidated on the Main Thread!
2022-01-24 10:56:37.395 java[94984:1325231] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(0   CoreFoundation                      0x00007fff2062a1db __exceptionPreprocess + 2421   libobjc.A.dylib                     0x00007fff20363d92 objc_exception_throw + 482   CoreFoundation                      0x00007fff206528e6 -[NSException raise] + 93   AppKit                              0x00007fff22de1eb2 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 3214   AppKit                              0x00007fff22dccaa2 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 12965   AppKit                              0x00007fff22dcc58b -[NSWindow initWithContentRect:styleMask:backing:defer:] + 426   libnativewindow_macosx.jnilib       0x00000001b2269502 Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 3547   ???                                 0x000000011937caa8 0x0 + 4718054056
)
libc++abi: terminating with uncaught exception of type NSException
  • 参考网页

  搜索了一下,说JDK242正常,252出现的问题。

java - Apple AWT Internal Exception: NSWindow drag regions should only be invalidated on the Main Thread - Stack Overflow

  吾试了一下,使用官方发布的JDK202确实是可以的。由错误变成了警告。下载链接:

Java Archive | Oracle

  •  原因分析

  对比老新版本的JDK输出,由Warning变成了Error。说明JDK本身没有变化,变化的是Xcode版本(新版本要求必须在主线程进行某些操作)。而其他软件没有及时跟进,于是出错了。

  相关解决方案