Missing .classpath file in Eclipse project

后端 未结 10 953
傲寒
傲寒 2021-02-04 06:11

I have recently returned to a project after not using it for a couple of weeks. The project was not created in Eclipse it was imported, and there is no \'.classpath\' file in t

相关标签:
10条回答
  • 2021-02-04 06:34

    The .classpath file in eclipse is a configuration file (in XML) which stores the project classpath properties. If it can't be written, perhaps it's an access problem. Right-click the file in windows explorer and check under the security tab to see if you have write permissions. You may have to run Eclipse as administrator.

    0 讨论(0)
  • 2021-02-04 06:34

    As doc_180 mentioned, the .Classpath would be hidden. Right click > Properties and Unhide the file, you should be ok.

    0 讨论(0)
  • 2021-02-04 06:34

    Just had the same issue after trying to create my view on a new PC. The cause of the issue for me was that .classpath file was marked as read-only, for whatever reason. To resolve this I did the following:

    Go to workspace directory --> Java Source folder --> Project Directory --> right click on .classpath and select Properties from the list --> uncheck 'Read-only' and/or 'Hidden' attribute checkbox(es) --> Click 'Apply' button.

    0 讨论(0)
  • 2021-02-04 06:41

    Right click Project >> Source >> Format - worked for me!

    0 讨论(0)
  • 2021-02-04 06:41

    An intern here just had this problem. He put the project on the user Document folder. I moved his project to the Eclipse workspace folder, removed the project from Eclipse and imported it again. Then the .classpath file was generated.

    0 讨论(0)
  • 2021-02-04 06:47

    I had the same problem. I had just setup a new PC, I transferred my projects to the new PC, clicked on the workspace directory, and changed the permission so that I (the 'me' on my new PC) owned all the files in all all sub-directories. However, even after doing this, eclipse couldn't write to the .classpath files. I verified that I could write to them using notepad, and that worked fine. I also verified that the O/S knew I was really the owner, but it didn't help. I also tried running as admin, but that didn't help either.

    Then I found this link: http://blog.ryanrampersad.com/2010/03/03/setting-build-path-has-encountered-a-problem-in-eclipse/, which indicates that when you copy files to a windows7 machine, windows may set the 'hidden' attribute on the file, and when this happens, eclipse can't work with it. I did a find files from the workspace directory, looking for '.project' (and subsequently '.classpath'), and selected all the files, right-clicked, and un-checked the 'hidden' attribute. This fixed my problem.

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