izb
izb

Reputation: 51850

Can I set up arbitrary commands in an Eclipse Java project run configuration?

I have a Java Eclipse project, but I don't run it from the command line using java.exe. Instead I run it through a python script that runs the java.

What I'd like to do is run this when I hit the 'Run' button in eclipse and see the output in Eclipse's console window. Unfortunately the available run configuration options available are a little too restrictive and don't seem to allow for this arbitrary 'run anything you like' configuration.

Is this possible? Are there any eclipse plugins that add this kind of configuration option?

I realise I'd probably lose debugger support, but this is not an issue for me.

Upvotes: 1

Views: 328

Answers (1)

VonC
VonC

Reputation: 1328712

You could run it through an "external Tools Configuration": it can call any script/command you like, even if that script launches itself your Java program.

alt text
(source: abdevelopment.ca)

Then, once it is launched, you can initiate a remote debug session, provided your script did launch the Java program with the right options

-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

alt text http://www.nakov.com/blog/wp-content/uploads/2008/08/eclipse-remote-debug-configuration.png

Upvotes: 5

Related Questions