java - 当 运行 从 Eclipse 重新加载 simphony 时出现 NSException 错误

java - NSException error when running repast simphony from Eclipse

当 Eclipse 出现提示时,我遇到了一个错误,该错误会阻止 运行ning 中的 repast simphony。 运行在出现提示时创建模型,window 消失并且 Eclipse 中出现一条错误消息。

到目前为止,我在我的 Mac(用于 repast simphony 设置)上遵循的步骤是:

1) 从 Adopt Open JDK 下载 Java 8 JDK(因为我需要 Java 8 才能稍后使用 repast 3D)。将包复制到/Library/Java/JavaVirtualMachines.

2) 下载 Eclipse IDE for Eclipse Committers 2019-06 并放入 Applications 文件夹。

3) 从更新站点 (https://dist.springsource.org/release/GRECLIPSE/3.4.0/e4.12) 安装 Groovy Eclipse 3.4.0,并安装 Eclipse Groovy 开发工具和 Groovy 编译器 2.4这个 link 在 Eclipse 中。

4) 在 Eclipse 中从 https://repocafe.cels.anl.gov/repos/repast 安装 repast simphony 2.7.0。

5) 在 Eclipse 中将 Groovy 编译器设置为 2.4.17。

6) 导入就餐示例

7) Select 演示模型(例如 GeoZombies)并尝试 运行。

完成上述第 7 步后,我收到几条控制台警告消息:

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/Applications/Eclipse.app/Contents/Eclipse/plugins/repast.simphony.runtime_2.7.0/lib/xstream-1.4.7.jar) to field java.util.TreeMap.comparator WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

即使 Eclipse 控制台中出现此错误,repast simphony 的 Java window 也会打开。但是,当我在 GeoZombies 的 Java window 中单击 "Start Run" 按钮时,Java window 会在没有警告的情况下关闭,并且 Eclipse 控制台会生成以下错误:

2019-12-03 11:03:46.637 java[63571:533520] * 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 0x00007fff3bab6acd __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff66193a17 objc_exception_throw + 48 2 CoreFoundation 0x00007fff3bad0629 -[NSException raise] + 9 3 AppKit 0x00007fff390765ca -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 317 4 AppKit 0x00007fff390739f7 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1479 5 AppKit 0x00007fff3907342a -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45 6 libnativewindow_macosx.jnilib 0x0000000136bfdf9e Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398 7 ??? 0x000000011e0f5c90 0x0 + 4799290512 ) libc++abi.dylib: terminating with uncaught exception of type NSException

如果有人可以提供有关如何解决此错误并使 repast simphony 正常工作的任何帮助,我将不胜感激。谢谢。

这似乎是让 Eclipse 知道要使用哪个 JRE 的问题。导航到 Preferences -> Java -> Installed JREs,应该显示 Eclipse 正在使用哪个 JRE,你可以在那里调整到合适的版本。目前可以使用Java8和Java11。有关 Repast Simphony 软件要求的更多信息,请参阅此页面:https://repast.github.io/requirements.html