Eclipse Error: 'Setting build path' has encountered error
Asked Answered
S

7

23

I am using an API called jtwitter. It has a single jar file jtwitter.jar I have been working with it and maintained it using git. I hosted the code in github. For somedays, i have not touched its code. Today, when i cloned my git repo (actually my system got a crash some days back so I had to clone ) and loaded the project into eclipse. Now when i wanted to add the jtwitter.jar into the buildpath, the following error occurs.

I am giving the partial exception stack trace here

java.io.FileNotFoundException: D:\workspace\ltwitter\.classpath (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at org.eclipse.core.internal.filesystem.local.LocalFile.openOutputStream(LocalFile.java:377)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:956)

please help.

Summarize answered 11/12, 2009 at 13:29 Comment(0)
P
10

Make sure that the directory and file are still there, take a look at D:\workspace\ltwitter is a valid path, has a .classpath file and it is readable. Try opening .classpath in Notepad for a test of readability.

Porpoise answered 11/12, 2009 at 13:33 Comment(3)
ya, your solution worked for me. But the thing I dont understand is that when i clone a git repo (which is actually an eclipse project root directory), the .classpath and .project files are changed to hidden files under windows explorer.. you got any idea about it ?Summarize
This should not be accepted as an answer. What Sentry said is a better answer.Alitaalitha
Technically this answer doesn't really have a solution, it just says to look at a file and see if it is there. I'm guessing, we change a checkbox???Crissy
S
102

I had the same problem, and I found out it was because the .classpath file was hidden. Removing the hidden attribute resolved the issue.

Sportswear answered 20/6, 2011 at 12:23 Comment(5)
Also had to do the same for the .project fileWooldridge
apparently windows sets the hidden attribute when copying the files using windows file sharingOrganogenesis
Right click on .classpath file and select properties. At the bottom of the window, uncheck the "Hidden" attribute checkbox.Horick
+1. This should be the accepted answer. If you have a problem with finding hidden files, go into Control Panel, choose Folder Options, click on the View tab, then under the Advanced Settings, choose "Show hidden files, folders and drives". You should be able to find the .classpath file in your working directory after.Countryandwestern
Worked like charm :) thanxFlick
C
13

I had the same issue with 64-bit Windows 7 and it was resolved by clearing the Hidden attribute.

Cuspidor answered 21/3, 2012 at 3:5 Comment(2)
THAT WORKED FOR ME on Windows 7 64 after many hours of frustration. I kept trying to clear the read only indicator on the folder (which I could not do even with the attrib command as instructed by MSN) but clearing the hidden bit did the job. Now I can attach a Javadoc to a referenced lib (jar).Whittier
If your copying the project from a MAC or Linux system to a windows OS then this is the fix. Please remove the check mark for hidden on .classpath and .project files.Ellene
P
10

Make sure that the directory and file are still there, take a look at D:\workspace\ltwitter is a valid path, has a .classpath file and it is readable. Try opening .classpath in Notepad for a test of readability.

Porpoise answered 11/12, 2009 at 13:33 Comment(3)
ya, your solution worked for me. But the thing I dont understand is that when i clone a git repo (which is actually an eclipse project root directory), the .classpath and .project files are changed to hidden files under windows explorer.. you got any idea about it ?Summarize
This should not be accepted as an answer. What Sentry said is a better answer.Alitaalitha
Technically this answer doesn't really have a solution, it just says to look at a file and see if it is there. I'm guessing, we change a checkbox???Crissy
G
2

Check directory permissions on D:\workspace\ltwitter and file permissions on D:\workspace\ltwitter\.classpath.

File Properties->Security tab in Windows Explorer

Gilletta answered 11/12, 2009 at 13:33 Comment(0)
C
0

Does D:\workspace\ltwitter\ exist? Do you have access to it? Is this where the project lies?

You can fix the build path using the context menu of the project -> Build Path -> Configure Build Path. There you can see all entries, the ones which are not valid are marked as such.

Chemoreceptor answered 11/12, 2009 at 13:33 Comment(0)
N
0

Assuming the directory exist and has the proper authorization, check also your logs for missing properties during eclipse launch (see this thread)

If you find some missing properties, try this eclipse.ini

Novara answered 11/12, 2009 at 13:37 Comment(0)
H
0

On Mac, Below command helped me to resolve this.

sudo chmod 777 .classpath

Headley answered 18/9, 2019 at 20:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.