eclipse 恢复之前因eclipse异常退出而丢失的Java源代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14108475/
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
Recover lost Java source code due to previous abnormal exit of eclipse
提问by Johny Smith
My java code which almost spanned 3000 lines was open on Eclipse code window as I was working on that. Suddenly my PC froze and I had to restart it. Later when I opened eclipse it threw some error saying some org.eclipse... file was corrupt, dint bother to write it down, my fault :( But later it showed "could not read metadata for workspace dir.metadata.plugins\org.eclipse.core.resources.root.indexes\properties.index" in my java code file. I restarted eclipse to get rid of the error, but the result was disastrous; the java code file was empty. My worry is, after my last backup, I had done a lot of changes to it here n there.
我在 Eclipse 代码窗口中打开了几乎跨越 3000 行的 java 代码。突然我的电脑死机了,我不得不重新启动它。后来当我打开 eclipse 时,它抛出了一些错误,说一些 org.eclipse... 文件已损坏,我不想把它写下来,我的错:( 但后来它显示“无法读取工作区 dir.metadata.plugins\org 的元数据” .eclipse.core.resources.root.indexes\properties.index”在我的java代码文件中。我重新启动eclipse以摆脱错误,但结果是灾难性的;java代码文件是空的。我担心的是,在我上次备份,我在这里和那里做了很多更改。
Finally I could figure it out. jst need to compare with local history :P
终于我想通了。jst需要与本地历史进行比较:P
回答by Rahul Bisht
Am not sure if this will work but you can give these 2 methods a try:
不确定这是否有效,但您可以尝试以下 2 种方法:
- Right click file-->Team-->Show local history (Try to look for the file in "history view")
- 右键文件-->团队-->显示本地历史(尝试在“历史视图”中查找文件)
If this fails,try 2. Manually go to "Eclipse workspace.metadata.plugins\org.eclipse.core.resources.history" You can find a list of folders named with few letters, use the “Date Modified” column and open the latest of those folders to get the recent files you were working on. In that folder, you can find some files with unusual naming, open the files with some text editor to find the file you are searching for, if possible try to match the file size.
如果失败,请尝试 2.手动转到“Eclipse workspace.metadata.plugins\org.eclipse.core.resources.history”您可以找到一个以几个字母命名的文件夹列表,使用“Date Modified”列并打开最新的这些文件夹以获取您最近处理的文件。在该文件夹中,您可以找到一些命名异常的文件,用一些文本编辑器打开文件以找到您要搜索的文件,如果可能,请尝试匹配文件大小。
Let me know if this helps. :)
如果这有帮助,请告诉我。:)
回答by Umesh .A Bhat
Welcome to Stack Overflow, Johny
欢迎来到 Stack Overflow,约翰
I think you may find your code in your 'Local History'
我想您可能会在“本地历史记录”中找到您的代码
Refer :
参考 :
How to recover Java file from Eclipse Project that damaged by getting power off?
如何从因断电而损坏的 Eclipse 项目中恢复 Java 文件?
http://www.coderanch.com/t/473927/vc/recover-java-File-Deleted-Eclipse
http://www.coderanch.com/t/473927/vc/recover-java-File-Deleted-Eclipse