I'm working on a context simulator named siafu, just the first step, try to build and run it on Mac OSX 10.6.8, but I'm confused that it fails to run with Exception:
***WARNING: Display must be created on main thread due to Cocoa restrictions.
Exception in thread "GUI thread" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Display.error(Unknown Source)
at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
at org.eclipse.swt.widgets.Display.create(Unknown Source)
at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at de.nec.nle.siafu.graphics.GUI.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
The script to run is like this, can anyone kindly point out why do we have exception even though we have specify the -XstartOnFirstThread?
#!/bin/sh
if [ "$1" = "-h" ]; then echo "Syntax: $0 [SimulationJarFile]"; exit 1; fi
if [ -n "$1" ]; then SIMULATION="--simulation=$1"; fi
java -Xmx512m -XstartOnFirstThread -classpath \
lib/org.eclipse.swt.osx64.jar:\
Siafu.jar:\
lib/org.apache.commons.collections-3.2.1.jar:\
lib/org.apache.commons.configuration-1.6.0.jar:\
lib/org.apache.commons.lang-2.4.0.jar:\
lib/org.apache.commons.logging-1.1.1.jar \
de.nec.nle.siafu.control.Siafu $SIMULATION