views:

97

answers:

3

I am trying to run an automated suite every day at the same time, so I want to create a task to open eclipse and execute the main script every day. Is there a way to do this from the command line?

+1  A: 

Instead of using eclipse for it, use a software that is dedicated for it - continous integration servers are created for it. Check such titles like: hudson, cruiseControl, TeamCity

Luno
+1  A: 

You are on the wrong path. Instead of trying to automate opening eclipse, executing a main... break the IDE dependency, write a portable build script using Ant or Maven and execute that build script outside the IDE (using a simple cron job or something more elaborated like a Continuous Integration tool but I'm not sure you need a CI tool for now, start with the build script).

Pascal Thivent
A: 

So I am assuming that you want to automate something that you run from inside eclipse. if it's a build then I'm with the other guys that using a build script and CI is the way to go.

But in case it's not that use case...

Now, if you are using the "Run.." dialogs to do this you can actually get the command line paths, binaries and arguments that eclipse used to execute.

What you do is open up the debug perspective. Then run your script however you normally do.

Your Process should appear in the "Debug View" at this point.

Either while the process is running or after termination, right click on the process and open up the properties. (you may need to click 1 level down in the tree to get this option)

Under process info, inside of that there is a section "Command Line". This is the exact command line that eclipse executed behind the scenes to run.

you should be able to put this into a script (.bat for windows / sh for *nix) and schedule accordingly.

edit: added in assumptions, changed to use process info terms which is what is on the properties screen.

smokeysonora
I don't think that's quite what he was asking about... he's not asking how to run a command line program from eclipse, he's asking how to launch eclipse from the command line to then cause eclipse to do something (e.g., run a build).
Suppressingfire
ahhh, ok I didn't preface my answer well enough. I was not intending to show how to execute a command line, but to explain how to get the actual command line that eclipse used in the "run a build" command.
smokeysonora