Yesterday, i've Closed Eclipse & then Turned Off The Computer, Now it's appear that a Crash has occured, when i started Eclipse again, Project List was empty So i've imported the Projects Again,
Problem : a Java Files is now corrupted, the file size seem correct, i can Open the File but the File is filed with "NUL" when i open it with a Text Editor & is empty when i open it in Eclipse,
I've tried to use the History Features of eclipse but there is No Any Backup in the .History Folder, only empty folders,
Is there any way to recover this Damaged .Java File ?
Thanks
if you use SVN, or other version controls, or ever back up your PC, you could look at restoring it from there. However, by your description, this doesnt seem likely.
Noting from your comments you have tried a system restore.. System restore points and backing up your PC are two different things.
Right click on your file -> Properties.
The click "Previous Versions" along the top.
It may say "There are no previous versions available", or may offer a restore choice.
Perhaps if you had previously deployed the project you can get at the class file and de-compile the class back to code but that may still result in some loss. Also just try doing a search on your machine for that file name perhaps it was backed up by you at an earlier time that you forgot about.
Related
I normally only use Eclipse just to code in Java for class, but today I decided to use it for my own personal projects. I didn't download anything funky and essentially only used FileWriter, java.util, java.io, and ArrayLists.
Suddenly, after running some code, I was told that Eclipse was no longer responding and had to force quit the program.
Afterward, I couldn't open Eclipse again because the workspace was currently in use.
I've looked up this problem numerous times, and what a lot of people were saying was to end Eclipse through the Task Manager and then go into the metadata file and then delete the .lock file, which I did. However, every time I opened Eclipse again, the program would load up, but there would be no workspace for me to work on. I'd try clicking the icon again, and now the "workspace was currently in use" window would pop up, and I'd go and see that the .lock file had reappeared in the metadata file, again, even though I'd deleted it.
I read somewhere else that another option was to relocate the metadata file, open and close Eclipse, and then overwrite the new metadata file, and it still hasn't worked, considering the .lock file ends up in the metadata again, somehow.
Is there any way I can fix this or am I just better off reinstalling Eclipse?
Thank you for any help, and sorry if this is very simpleāI'm still very new to all this!
About a month ago I went from Windows to a MacBook Pro.
Same Eclipse version, (almost) same settings, but it frustrates me that saving an xml file takes about 10s :(... Even if I just delete/add a space char.
I have a lot of files, about 10 projects opens in Eclipse but my old Windows box with an old quad core (not even an i7) had no problems with this.
I know this is a knows problem in Eclipse and I had it in the past as well, but it was solved after a few upgrades in the past.
Currently I run on the latests Luna version, with up2date plugins, tried a lot of possible solution, most from SO, but still not solved. Please some help.
I am using EE Eclipse to mainly develop java web apps and use the following plugins: AspectJ (with Xref), EGit, JGit, CheckStyle, Maven, TestNG.
All files are stored as UTF-8
Editing the xml file is slow in both the text and the xml editor.
It concerns xml files that are located in a java package (in the /src/main/java/ folder).
The strange thing is that Editing an xml file in a project-root subfolder isn't slow, like: project-root/test-output/bla.xml (works well in both the text and xml editor)... weird...
Both files (the slow and fast save one) are part of version control and used by Git.
In case I copy the slow file to the folder project-root/test-output/, it's also saved fast :(
Renaming the slow file such that it has the "txt" extension and editing with the text editor has not effect.
I thought it is caused by some builder that works only on the java source folder...
The project has a Java and Maven builder. Disabling them has no effect.
The Eclipse log file doesn't contain any relevant exception. It contains some key-binding exceptions and resource tree locked modifications, but these exceptions are old.
What I tried (what I can remember):
+ Disabled all validation (especially the xml validation), for all projects.
+ Ensure all latest updates are installed of all plugins, including the EGit plugin.
+ Disabled Checkstyle.
+ ...
Any ideas as I am getting a bit frustrated about this?
A poor-man's solution may be in
switch to a empty workspace (workspace2 in example)
create a new pde-plugin-project (mytestplugin in example)
debug the mytestplugin means you debug a instance of eclipse too, so use the workspace you usually work with in the debugging-second-eclipse.
Now: save the xml-file in the debugging-second-eclipse with the workspace you usually work with, quick jump to the first eclipse and press "pause" to stop the second-eclipse.
inspect the compleate debug-stacktrace-thread-tree in the debug view (please post the image as a comment here).
Regards
When Trying the solution of #Peter I noticed that the workspace I was using was located in the "eclipse.app" file like this:
/Applications/eclipse/Eclipse.app/Contents/MacOS/D:\Users\Ed\Develop\Projecten\EclipseWorkSpace/
No idea why/how this happened. However, I moved this workspace to a "normal" directory in my home folder, and how saving an xml file work normal, fast as expected...
No idea why having the workspace located in the eclipse.app made it slow, but it works ...
Open eclipse.ini.
Increase -Xms, -Xmx
This works for me.
Eclipse crashed, works space now can't be opened, and importing the projects wont work either. That about explains it all right there.
Creating a new workspace, I still cant import any of the projects. It acts like it is about to, but then nothing.
Any ideas? Not all of the projects are on svn.
Here are some of the errors i see in the crash reports
The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state.
Premature end of file.
does not exist
and the message that appeared before it all crashed and burned
java.lang.OutOfMemoryError: Java heap space
NEW INFO
every single file in every single on of my projects, now has a size of 0kb. all the files exist, but every .png, .jpg .class .xml is empty with a size of 0kb
try editing eclipse.ini file.
put put -Xms512m -Xmx1024m
then try to restart eclipse it should work!!
Can you install a second instance of Eclipse and point it at the workspace? I've done this with the ADT on my mac before.
I have had similar trouble with corrupted workspaces in the past. They don't load even in a fresh copy of Eclipse.
What has helped me is deleting/renaming file myWorkspace/.metadata/.plugins/org.eclipse.core.resources/.snap
Sometimes also deleting *.snap files.
Please backup the whole workspace (including projects) first!
Close eclipse.
Copy your wanted project files (ie. workspace\Homework) to a temp directory, not the entire workspace.
Start eclipse.
Create a new workspace (you stated you could).
Delete the old workspace (might be able to this before previous step).
Import project from temp directory into new workspace.
Save!
Close and re-open eclipse.
The "NEW INFO" section makes it look like you are out of disk space on the system. Have you checked?
I have a massive problem, and I can't find a single thread out there that specifies this problem.
I'd been watching Google IO, and the Android Studio was mentioned, I downloaded it, installed it, and opened my project into there, as I wanted to try out some of the new features, Fine and dandy, (on a separate note, I love Android Studio)
It was working before in Eclipse, and I literally changed nothing about my project, I was only looking around at the device preview features and stuff, didn't touch any piece of code what so ever, just having a look at some of the features..
Went back to eclipse, and my generated folder only showed R in, no tree structure of R or anything, just R.java, and R inside it, and everything in my classes were underlined, but it wasn't the R that was, it was the value after it (ie. Cannot find R.layout.main) which I thought was really weird, so I cleaned my project, and it disappeared, I now have a project without a generated R.java file.
To note; I changed nothing about my project, all my XML files were absolutely fine, i've tried every trick I can find on StackOverFlow and other websites (removing some of the XML's, painstakingly going over my 15 layout files character by character for an hour, removing imports, build paths, etc) and nothing works, and i've been trying to do this for almost 3 hours now.. Does anyone have any experience doing this, or any solution?
in the Gen section of your project, try to delete the R.java
It should re-generate, I had some issues like that in the past..
Give it go.
The R file may not be generated due to errors in the project.
Check your xml files in res folder. Also read Error log of the eclipse.
(Windows -> Show View -> Problems)
The best way is copy R.java from another project and Past it in gen
And then Delete R.java file then the system will recreate R.java back for you..........
I have a fairly large Eclipse project that has undergone several major refactorings over the past 6 months. Packages have been added, deleted, renamed (using Refactor >> Rename), and the same for source files within those packages.
Today I wanted to get a count of how many source files I had under the project root and was startled by what AgentRansack returned. I was expecting something on the order of 200 - 250, but it turned back ~325. I started looking at the list of files, and, sure enough, some of them were Java files I deleted eons ago.
I opened up Windows Explorer and took a gander at my project directory, and of course, saw them all just sitting there on my file system, like nothing ever happened to them.
Obviously, Eclipse is rendering a "view" (of some sort) of my project directory, and is using some kind of metadata to mark "deleted" ones, renamed ones, etc. But to the file system, nothing is changing.
Ordinarily I wouldn't be upset about this, but I just went to import a class that used to be pacakged as org.me.myproj.fizz.Widget, but was later refactored to be packaged as org.me.myproj.buzz.Widget. When I hit the shortcut (Ctrl+Shift+O), Eclipse asked me which Widget I wanted - but the first one shouldn't even exist anymore!!!
When I'm deleting packages/folders/files in Eclipse, or if I'm renaming/moving them via Refactor >> Rename/Move, how do I make sure the changes are permanent to the underlying file system??