Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't save project preferences in Eclipse

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.

like image 950
Real Red. Avatar asked Jun 05 '09 04:06

Real Red.


3 Answers

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.

like image 181
Njol Avatar answered Oct 30 '22 02:10

Njol


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".

like image 36
VonC Avatar answered Oct 30 '22 02:10

VonC


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.

like image 40
Indivara Avatar answered Oct 30 '22 04:10

Indivara