Java 打开 eclipse 时显示错误消息:发生错误。查看日志文件为空。这个解决方案怎么样?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32944658/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 14:03:50  来源:igfitidea点击:

Display error message when open the eclipse: An error has occurred. See the log file null. How about this solution?

javaeclipse

提问by Leang Socheat

I use Windows 10 and jre1.8.0_51. I don't know why when I start Eclipse it always displays an alert message "An error has occurred. See the log file null."

我使用 Windows 10 和 jre1.8.0_51。我不知道为什么当我启动 Eclipse 时它总是显示一条警告消息“发生错误。查看日志文件为空。”

And I cannot open Eclipse thereafter. I tried to search Google and have no best solution. I uninstalled JRE and installed it again, but it still produces the same problem. How about a solution?

此后我无法打开 Eclipse。我试图搜索谷歌并没有最好的解决方案。我卸载了 JRE 并重新安装了它,但它仍然产生同样的问题。怎么解决?

采纳答案by Fidias

Had same issue after I restored Windows 10. I tried the suggestions here and in other questions but nothing helped (e.g. deleting .metadata folder, starting eclipse as admin, etc). Ended up reinstalling Java and eclipse which solved the issue for me.

在我恢复 Windows 10 后遇到了同样的问题。我在这里和其他问题中尝试了这些建议,但没有任何帮助(例如删除 .metadata 文件夹,以管理员身份启动 eclipse 等)。最终重新安装了 Java 和 eclipse,这为我解决了这个问题。

回答by Viraj Nalawade

Try to launch it from the console like:

尝试从控制台启动它,如:

C:\path\to\eclipse\eclipse -clean

Also you try to can delete the file to fix the problem permanently as suggested here. Command would be something like below for windows.

您也可以按照此处的建议尝试删除该文件以永久解决问题。对于 Windows,命令将类似于以下内容。

del  YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.snap

回答by Bally

I had the same issue with Windows 10. Give full control to your user in security settings on the eclipse and workspace folders.

我在 Windows 10 上遇到了同样的问题。在 Eclipse 和工作区文件夹的安全设置中完全控制您的用户。

I also found the read only property was set on the eclipse and workspace folders, which I unset.

我还发现在 eclipse 和 workspace 文件夹上设置了只读属性,我取消了设置。

The log file can be found in the eclipse\configurationfolder.

可以在eclipse\configuration文件夹中找到日志文件。

回答by Luis Ramos

I ran into the same problem. When I try running eclipse as Asministrator, the problem went away.

我遇到了同样的问题。当我尝试以 Asministrator 身份运行 eclipse 时,问题就消失了。

回答by Tokci

Make sure your eclipse launch folder does not have read only property/attribute

确保您的 eclipse 启动文件夹没有只读属性/属性

My eclipse resides at below location and If I right click ->properties- checked attributes were read only. I unchecked read only and restarted eclipse. Issue was resolved. C:\Users\Ashish\Downloads\eclipse-jee-mars-2-win32-x86_64 (1)\eclipse

我的日食位于以下位置,如果我右键单击 -> 属性 - 选中的属性是只读的。我取消选中只读并重新启动eclipse。问题已解决。C:\Users\Ashish\Downloads\eclipse-jee-mars-2-win32-x86_64 (1)\eclipse

回答by Affa Musaffa

Here I'm just share, if you can not copy file .metadata on mac because that file invisible (JUST on Mac issue), try this step:

在这里我只是分享一下,如果您无法在 mac 上复制文件 .metadata 因为该文件不可见(仅在 Mac 上),请尝试以下步骤:

  1. compress your file .metadata backup
  2. copy file .zip
  3. paste file .zip to path/workspace
  4. double click file .zip
  5. done :-)
  1. 压缩您的文件 .metadata 备份
  2. 复制文件 .zip
  3. 将文件 .zip 粘贴到路径/工作区
  4. 双击文件 .zip
  5. 完毕 :-)

回答by Harun

Open the eclipse.exe with the right mouse button and open with admin rights and that's it!

用鼠标右键打开 eclipse.exe 并用管理员权限打开,就是这样!

回答by shilpa

I deleted .metadatafrom the workspace and ran the eclipse as run as administratorand it worked for me.

.metadata从工作区中删除并以管理员身份运行eclipse ,它对我有用。

回答by Prem S

I had the same problem and deleting the file .metadata/.plugins/org.eclipse.core.resources/.snap and try it should work

我有同样的问题并删除文件 .metadata/.plugins/org.eclipse.core.resources/.snap 并尝试它应该工作

回答by mohdasha

I too came across the same error. My log file says : Java.io.FileNotFoundException: C:\Eclipse\eclipse-jee-luna-SR2-win32-x86_64\eclipse\configuration\org.eclipse.osgi.manager.fileTableLock (Access is denied)

我也遇到了同样的错误。我的日志文件说: Java.io.FileNotFoundException: C:\Eclipse\eclipse-jee-luna-SR2-win32-x86_64\eclipse\configuration\org.eclipse.osgi.manager.fileTableLock(访问被拒绝)

So, i copied entire eclipse in another folder and it worked for me.

所以,我将整个 eclipse 复制到另一个文件夹中,它对我有用。

So, for me the problem was write access, because eclipse need write across configuration folder, in my case eclipse was unzipped by some other user and i didn't have the access.

所以,对我来说,问题是写访问权限,因为 eclipse 需要跨配置文件夹写入,在我的情况下,eclipse 被其他用户解压缩,我没有访问权限。