I have just set up Nailgun (https://github.com/martylamb/nailgun, http://martiansoftware.com/nailgun/), which is a clever piece of kit which makes the JVM hang around in memory making Java and Jython (potentially) launch more quickly.
This is great for Java, but it promises to be absolute gold dust for me for Jython, particularly during development (Jython is the best language in the world, but has a slow start-up time).
Googling to see whether anyone had tackled running Nailgun on Eclipse I found a red herring, which is "nailgun/eclipse-gtkrc" at GitHub: "nailgun" is just the guy's handle. I also found a CS dept had in fact tackled this, at http://www.cs.dartmouth.edu/~jygsaw/getting_started.html. They seem actually to have managed getting this working for Jython, which was potentially brilliant, but unfortunately their system relies on using a BASH script (Mac OS), and I'm forced to work on Windows (W7) for the moment.
What I then did was
1) Started up the Nailgun server outside Eclipse, including jython.jar in the CLASSPATH,
2) Then I created a client.bat file consisting of a single line:
ng org.python.util.jython %1
3) Then I set up an "external tool configuration" in Eclipse called "ng_client", as per the above CS dept's instructions, except that I set the Location to the above client.bat file, and I made the Arguments: "${selected_resource_loc}"
(<-- including quotes, because unfortunately at the moment I have spaces in this path)
4) I ran this "ng_client" once so it failed, but was then included in this External tools list of tools.
5) I then selected a trivial Jython py file (trivial.py) and went Run --> External tools --> ng_client.
The console showed the following result
C:\Program Files (x86)\eclipse-jee-luna-SR2-win32\eclipse>ng org.python.util.jython "G:\My Documents\software projects\trivial.py"
recv: No error
NB "recv: No error" is in red. The program, I hasten to add, did not run.
Incidentally, for anyone interested, this led to the Nailgun server terminal giving out the following error message:
C:\Users\Mike>java com.martiansoftware.nailgun.NGServer
NGServer 0.9.2-SNAPSHOT started on all addresses, port 2113.
NGSession 1: 127.0.0.1: org.python.util.jython exited with status -1
java.lang.ClassCastException: org.python.util.JLineConsole$Stream cannot be cast
to com.martiansoftware.nailgun.ThreadLocalInputStream
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:263)
Exception in thread "NGSession 2: 127.0.0.1: org.python.util.jython" java.lang.C
lassCastException: org.python.util.JLineConsole$Stream cannot be cast to com.mar
tiansoftware.nailgun.ThreadLocalInputStream
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:381)
I seem to be quite close ... does any Eclipse expert have any idea how I should proceed?
PS I've also tried running a trivial Jython program outside of Eclipse. So far it always trips up the Nailgun server as above. There is a bit of evidence out there of people doing it successfully, but they always seem to be on a Linux box, not Windows. Naturally enough I'm planning to take a look at the server source code where the errors are happening in due course.