Eclipse无法从开放文件系统导入项目?

3

我之前已经导入了这个项目,一切都很好,但是后来更改了JRE库或删除了元数据文件夹,不知道我做了什么或者是一个错误。

它开始出现错误,然后我删除了这个项目。现在我从不同的文件位置重新启动这个项目,但仍然出现错误。

不太清楚发生了什么,但这就是我在弹出窗口中收到的错误。

输入图像描述此处

  !ENTRY org.eclipse.egit.ui 2 0 2018-12-13 10:55:49.034
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\abc'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

!ENTRY org.eclipse.ui.ide 4 0 2018-12-13 10:56:18.878
!MESSAGE Could not import project located at C:\Program Files (x86)\Futronic\SDK 4.2\Examples\Java
!STACK 0
org.eclipse.ui.internal.wizards.datatransfer.CouldNotImportProjectException: Could not import project located at C:\Program Files (x86)\Futronic\SDK 4.2\Examples\Java
    at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.toExistingOrNewProject(SmartImportJob.java:518)
    at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.run(SmartImportJob.java:239)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.core.runtime.CoreException: Could not write file: C:\Program Files (x86)\Futronic\SDK 4.2\Examples\Java\.project.
    at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:49)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openOutputStream(LocalFile.java:410)
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:1159)
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.internalWrite(FileSystemResourceManager.java:674)
    at org.eclipse.core.internal.resources.Project.writeDescription(Project.java:1365)
    at org.eclipse.core.internal.resources.Project.writeDescription(Project.java:1346)
    at org.eclipse.core.internal.resources.Project.create(Project.java:289)
    at org.eclipse.core.internal.resources.Project.create(Project.java:247)
    at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.createOrImportProject(SmartImportJob.java:557)
    at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.toExistingOrNewProject(SmartImportJob.java:505)
    ... 2 more
Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\Futronic\SDK 4.2\Examples\Java\.project (Access is denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openOutputStream(LocalFile.java:400)
    ... 10 more

1
看起来Eclipse在C:\Program Files (x86)\Futronic\SDK 4.2\Examples\Java没有写入权限,导致了这个问题。 - howlger
那么我该如何获取权限呢? - Arsalan
通过更改Windows中的权限或将“示例”文件夹移动/复制到例如“桌面”或“文档”中来实现。(默认情况下,“C:\Program Files (x86)”中的写入权限仅限于管理员。) - howlger
我不得不将程序从C盘的Program Files文件夹移动到桌面或下载文件夹,这样它才能正常工作。 - Arsalan
1个回答

0

看起来这个问题是由于 Eclipse没有写入权限 来在以下路径创建文件 C:\Program Files (x86)\Futronic\SDK 4.2\Examples\Java(当进行File > Open Projects from File System...时,Eclipse需要创建一些如.project的文件)。

为普通用户添加写入权限或者将该文件夹移动/复制到打开它的桌面文档文件夹应该可以解决这个问题(在Windows中,默认情况下,C:\Program Files (x86)C:\Program Files只有管理员才能创建文件)。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接