Eclipse 错误:“设置构建路径”遇到错误

发布于 2024-08-14 14:14:42 字数 670 浏览 3 评论 0原文

我正在使用一个名为 jtwitter 的 API。它有一个 jar 文件 jtwitter.jar 我一直在使用它并使用 git 维护它。我把代码托管在github上。 有些天,我没有碰过它的代码。今天,当我克隆我的 git repo 时(实际上我的系统几天前崩溃了,所以我不得不克隆)并将项目加载到 eclipse 中。现在,当我想将 jtwitter.jar 添加到构建路径中时,会发生以下错误。

我在这里给出部分异常堆栈跟踪,

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)

请帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

思念满溢 2024-08-21 14:14:42

我遇到了同样的问题,我发现这是因为 .classpath 文件被隐藏了。删除隐藏属性解决了该问题。

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

下壹個目標 2024-08-21 14:14:42

我在 64 位 Windows 7 上遇到了同样的问题,通过清除隐藏属性解决了这个问题。

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

天邊彩虹 2024-08-21 14:14:42

确保目录和文件仍然存在,看看 D:\workspace\ltwitter 是一个有效的路径,有一个 .classpath 文件并且可读。尝试在记事本中打开 .classpath 以测试可读性。

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.

梦纸 2024-08-21 14:14:42

检查 D:\workspace\ltwitter 上的目录权限和 D:\workspace\ltwitter\.classpath 上的文件权限。

Windows 资源管理器中的文件属性 -> 安全选项卡

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

File Properties->Security tab in Windows Explorer

凯凯我们等你回来 2024-08-21 14:14:42

D:\workspace\ltwitter\ 是否存在?您有权访问它吗?这是项目所在地吗?

您可以使用项目的上下文菜单修复构建路径 ->构建路径->配置构建路径。在那里您可以看到所有条目,无效的条目会被标记为无效。

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.

沧笙踏歌 2024-08-21 14:14:42

假设该目录存在并且具有适当的授权,请在 Eclipse 启动期间检查日志是否缺少属性(请参阅 此线程

如果您发现缺少一些属性,请尝试 这个 eclipse.ini

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

醉态萌生 2024-08-21 14:14:42

在 Mac 上,下面的命令帮助我解决了这个问题。

sudo chmod 777 .classpath

On Mac, Below command helped me to resolve this.

sudo chmod 777 .classpath

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文