Question

Why does eclipse break with the error "Could not write file: M:\workspaces\eclipse\project.project. M:\workspaces\eclipse\project.project (Access is denied)" when the .project file is hidden (on the Windows file system)? Note: This happens w/ other files as well.

Steps to Reproduce:
1. Install the latest eclipse, I am using eclipse-jee-galileo-SR2-win32.zip. (Not sure if it happens in other versions)
2. Create a project.
3. Browse to the project in windows explorer, find the .project file.
4. Right click -> properties
5. Under Attributes check hidden.
6. In eclipse, open the .project file, make a change and try to save.
7. After you get the error, uncheck the hidden box and save again.

Was it helpful?

Solution

Network drive can sometimes have the issue of marking files with the hidden attribute (see this thread for instance)

As illustrated by this IBM technote, this issue might be related to Sun bug 6350200:

When opening a hidden file for write access the FileNotFoundException exception is thrown. If you remove the hidden attribute (via attrib) the exception is not thrown and application works correctly.

Resolution: fixed with JDK6_b3 (what JDK are you using to run your eclipse?), but might still have some problem the IBM technote reports as fully fixed only in JDK7! So right now, you have to remove the hidden attribute for Eclipse to be able to successfully opened it and write in it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top