Can't save project preferences in Eclipse

后端 未结 5 1041
野的像风
野的像风 2021-01-12 12:49

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.

Pr

相关标签:
5条回答
  • 2021-01-12 13:22

    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.

    0 讨论(0)
  • 2021-01-12 13:23

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

    0 讨论(0)
  • 2021-01-12 13:29

    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.

    0 讨论(0)
  • 2021-01-12 13:31

    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.

    0 讨论(0)
  • 2021-01-12 13:32

    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.

    0 讨论(0)
提交回复
热议问题