Over a million developers have joined DZone.

Building Projects with Eclipse from the Command Line

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

Eclipse has a great user interface (UI). But what if I want to do things from the command line, without the GUI? For example to build one or more projects in the workspace without using the Eclipse UI? With this, I can do automated check-outs and do automated builds.

Performed a command line project build with Eclipse

Performed a command line project build with Eclipse

The solution to this: there is a command line version of Eclipse which I can use to run Eclipse in the command line version. Inside the eclipse folder on Windows, there is the eclipsec program which is the command-line version of Eclipse:

Eclipsec program, a command line version of Eclipse

Eclipsec program, a command line version of Eclipse

The options of this command line version (for Eclipse Kepler) are described here:

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

For example

eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data c:\my_wsp -build k64f

will launch Eclipse without splash screen (-nosplash), uses the -application command to load the managed make builder (which is used to build projects), with -data I specify the workspace to be used, and with the -build command it will the project k64f.

More options and details are shown here: http://stackoverflow.com/questions/344797/build-several-cdt-c-projects-from-commandline

And a very good article with additional background information how to use it with the GNU ARM Eclipse plubins can be found here: http://gnuarmeclipse.livius.net/blog/headless-builds/

Happy Headlessing :-)


The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}