Over a million developers have joined DZone.

Build Configurations in Eclipse

Usually we need to build our code in a variety of environments. Here's a walk-through of build configurations for users of eclipse based IDE's.

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

Eclipse-based IDE’s have a powerful feature to make ‘variants’ of the same projects: Build Configurations. Build configurations are a powerful thing in Eclipse: they allow me to make ‘variants’ of a project. The project will share the common things, and I can simply tweak things one way or the other for example to produce a ‘release’ or a ‘debug’ binary of my application without duplicate the project.

Build configurations are managed through either the context menu on the project or with the top menu:

Eclipse Project Build Configuration

Eclipse Project Build Configuration

I’m showing in this post screenshots from NXP Kinetis Design Studio V3.2.0, but things are applicable to pretty much any Eclipse-based IDE.

 Build configurations only apply to the build settings, and not to the debug settings.

With the ‘Manage’ option I can manage my configurations:

Managing Build Configuration Dialog

Managing Build Configuration Dialog

For example, I can add a ‘Release’ configuration with the ‘New’ button:

 See “Debug vs. Release?” for more thoughts on that topic.

Creating New Configuration

Creating New Configuration

I give a name and an optional description. I usually ‘clone’ from an existing configuration. That way I get a new configuration with a good starting point.

One configuration is always active, and the ‘manage’ dialog can be used to change the active configuration:

Active Build Configuration

Active Build Configuration

The active build configuration shows up in the list of configuration e.g. under the build ‘hammer’:

Active Build

Active Build

So how can I specify settings for a configuration? For this, there is a configuration area in the project settings:

Configurations in Project Settings

Configurations in Project Settings

There is a button to manage the configurations, and a drop down to select the configuration which I want to affect. There is also an item in the list called [All Configurations]: when using that item, changes are ‘pushed’ to all configurations.

For example, I can set a different compiler optimization for the Release configuration:

Release Configuration with high optimimzation

Release Configuration with high optimization

 When using multiple configurations, always check to which configuration you are making the changes.

The configuration name is used as the name for the output folder name:

Configuration Name in Output Folder

Configuration Name in Output Folder

That way for each configuration separate binaries are built.


Eclipse configurations are a great way to make different variants of projects. A new configuration can be cloned from an existing one, and then tweaked for example to build a release binary or to use custom build settings.

Happy Building!

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.


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.

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.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}