views:

145

answers:

2

Hello, I wrote a complex Java application with eclipse that uses many .jar libraries included into project folder.

Is there a quick way to export a running configuration of the application that allows me to run it from shell (I don't actually need to move it around machines, so no jar export or similar things).

I just need to detach the execution from Eclipse, but since project has many settings I would like to export a script (maybe .sh or just a plain long line) automatically..

Thanks!

+2  A: 

You can get the full command executed by your configuration on the Debug tab, or more specifically the Debug view.

  1. Run your application
  2. Go to your Debug perspective
  3. There should be an entry in there (in the Debug View) for the app you've just executed
  4. Right-click the node which references java.exe or javaw.exe and select Properties
  5. In the dialog that pops up you'll see the Command Line which includes all jars, parameters, etc
Adrian
Thanks, it was exactly what I was looking for!
Jack
+1  A: 
  • Starting with File menu
  • File -> Export Expand "General" node
  • Choose "Ant Buildfiles" Press "Next"
  • You will get a list of projects,
  • choose the project you wish to use. Press
  • "finish" button As a result,
  • you would get an ANT build file, which will have targets that points to your "Run configurations" for the given project.

Now, to run a run configuration "run-config-1" you may type on your command line (Assuming you have ant on your shell's PATH)

ant run-config-1
ring bearer
thanks but I prefer to avoid ant.. +1 anyway
Jack