I have been unable to get nREPL to work with SWT on Mac OS X.
To reproduce the problem, create a new SWT project with the following project.clj file:
(defproject swttest "0.1.0"
:description "Foo"
:dependencies [[org.clojure/clojure "1.4.0"]
[org.eclipse.swt/org.eclipse.swt.cocoa.macosx.x86_64 "3.8"]]
:jvm-opts ["-XstartOnFirstThread"]
:repositories [["swt-repo" "https://swt-repo.googlecode.com/svn/repo/"]])
Then launch the REPL using “lein repl”. Finally, run the following command:
user> (org.eclipse.swt.widgets.Display.)
The following error occurs:
SWTException Invalid thread access org.eclipse.swt.SWT.error (:-1)
How can I get this to work?
Found the solution. Instead of using nREPL, run it in a “dumb” REPL, by modifying the project.clj file to include a “dumbrepl” alias, like so:
Then run: