Can't save project preferences in Eclipse

15,064

Solution 1

If you follow this thread, this can be:

  • because of the use of Eclipse with a workspace on a network drive (not necessarily your case, but worth mentioning just in case)
  • because the file is somehow locked (either by another process or by a Version Control System with pessimistic locking). See also bug 130266:

Read-only project files come up a lot when dealing with source control systems (like Perforce) that make the local files read-only until they are "checked out".

Solution 2

Like Liam I store my project on Dropbox and use it on two different machines and also got the same error. A simple refresh (select the project and press F5, or rightclick on the project and choose Refresh) did the trick for me, as the resource was out of sync. This is usually displayed (e.g. in the editor when trying to edit a source file), but in the case of preferences you'll have to find that message in eclipse's log:

!MESSAGE Exception occurred while saving project preferences: /Utils/.settings/org.eclipse.jdt.core.prefs.
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: '/Utils/.settings/org.eclipse.jdt.core.prefs'.

This might actually be the issue for both of you, as any external modification to a project will cause this out of sync error, and creating a new workspace or using another eclipse version likely purges eclipse's cache, resulting in an automatic refresh.

Solution 3

Five years later and this still occurs. In my case I moved the .settings folder, saved again (.settings is created automatically) and merged the files manually.

Happens on Android Developer Tools Build: v22.6.2.

Solution 4

I had this problem also. I had used two versions of eclipse, one on my home machine (juno) and one on my work machine (indigo). Both shared the same folder using a Dropbox folder. All worked fine until I wanted to make some editor style changes, the settings would not save.

The solution in my case was to update the indigo version to juno on my work machine.

Solution 5

Check the project's Properties -> Java Compiler, and make sure the 'Compiler compliance level' is 1.8 or 1.7 instead of 1.4.

If this still fails to remove the error, deleting the .settings folder certainly works.

Share:
15,064
Real Red.
Author by

Real Red.

Surreal dreamer.

Updated on August 06, 2022

Comments

  • Real Red.
    Real Red. almost 2 years

    All I am trying to do is to set the Java compiler for my project as 5.0. It is 1.4 by default. When I try to save by pressing OK button I get the following error.

    Preferences Save Failed:

    Reason: Exception Occured while saving project preferences: /com.myproj.reqmanager.ui/.settings/org.eclipse.jdt.ui.prefs.

    I never got this error earlier. I mean I have imported this project before and saved preference settings without any problem. Out of nowhere I am getting this problem now.

  • Real Red.
    Real Red. almost 15 years
    Hey, thanks VonC. I had checked this and neither was applicable to me. However, I created a new workspace and continued my work. That was much faster. But, for the interest of it I will go back to my old workspace and try to get to the root of it.
  • VonC
    VonC almost 15 years
    @RCB thank you for this feedback. I f you do find the root cause, you could post it here as an answer (that I would upvote ;) ), and even select your own post as the official answer (no reputation gain involved here though)
  • Bogdan
    Bogdan over 8 years
    Refresh (F5) the full workspace and most likely all problems are gone.
  • John C
    John C almost 4 years
    Almost 11 years later and it still happens. Closing Eclipse, renaming the .settings folder, opening, saving, closing the workspace before copying back the original files solved my problem. But it's still frustrating (to say the least) that the only feedback Eclipse (now at version 2020-03 (4.15.0)) gives is still "Error while saving project settings".