Take the 2-minute tour ×

I am working with Eclipse (Indigo) to develop C projects. When I create a new C project in a new workspace, by default the "Autosave before build" option is not set. This is extremely frustrating, as autosave is usually the default behavior in other IDE's I worked on. I change some code, build and nothing seems to go as expected - until I remember that the option is not set...

Is there a way to make Eclipse open a new workspace with this option set?

share|improve this question
you mean there is an option in Eclipse where it auto saves for you? Really? :D –  Adrian Dec 28 '11 at 0:58
@Adrian - it took me some time and search to find out, but it hides in Window->Preferences->Workspace. I am just waiting to meet with the guy who decided on some of the eclipse design/environment defaults to strangle him with my bare hands... –  ysap Dec 28 '11 at 2:15
hehe thanks for revealing it :) –  Adrian Dec 28 '11 at 3:35
add comment

2 Answers

up vote 1 down vote accepted

Create a file named default.ini, or some other name, containing the following line:


In your eclipse.ini file which already exists, add the following lines somewhere before the -vmargs line:


Where /path/to/default.ini is the full path to the default.ini file you created in the first step. If Eclipse will be used by multiple users on this machine, default.ini should be accessible by all of them.

share|improve this answer
Thanks! What if I need it to be a relative path? What is the "working directory" this file is being processed at? Can I just put it in the same place as the eclipse.ini file (i.e., at the root of the eclipse installation) and discard the /path/to/ part? –  ysap Dec 28 '11 at 2:19
Just tried your method and it does not seem to work. I created the new file in the eclipse directory, then I added the 2nd line immediately before the -vmargs line and tried with and without the full path. –  ysap Dec 28 '11 at 4:04
Further investigating, I don't seem to have a plugin named org.eclipse.ui.ide. I do have two other named: org.eclipse.ui.ide_3.7.0.I20110519-0100.jar and org.eclipse.ui.ide.application_1.0.300.I20110306-2000.jar. Or is the 1st one the one I'm looking for? –  ysap Dec 28 '11 at 4:06
OK, I have found it! Searching the eclipse forum, I found a similar post with a similar solution - the problem is that the /path/to/def.ini should be on the next line. I guess this is what you meant in "add the following lines". Probably a formatting problem. –  ysap Dec 28 '11 at 4:24
[edited the answer to add the newline - waiting for peer review] –  ysap Dec 28 '11 at 4:28
show 2 more comments

In Eclipse CDT Kepler you can set it in:

Window -> Preferences -> General -> Workspace -> Save automatically before build
share|improve this answer
Thanks, but this does not answer the question. –  ysap Jul 15 '13 at 16:12
add comment

Your Answer


