English 中文(简体)
How to open and run a specific script from the command line in eclipse
原标题:

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?

问题回答

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

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).

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.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签