Eclipse crashed and deleted all my work - eclipse

Eclipse crashed and deleted all project files, including written by me and XML files from another program which were not related to Eclipse.
Is it possible to force Eclipse or JVM to use trash can, so that if it goes mad and delete everything, files could restored.
UPDATE
Files were definitely wiped out. This was checked with third party file managers. Also entire disc were searched for traces.
Some good news is that Eclipse history remained. This allowed to restore some files I changed from Eclipse. But this project was consisting of multiple other files, that were written not by me (taken from other libraries) or contained some data I was editing not in Eclipse (like XML or raw data).
All these files were wiped out by Eclipse.
If this would not happen to me I would also say it is unlikely. But it has happened.
The problem is somehow related with
(1) Eclipse
(2) Maven (m2e)
(3) Eclipse RCP
(4) Tycho
At some moment Eclipse started to show numerous error windows and I was to kill the process. After that I found files absent.
So I need some extra protection layer.
UPDATE 2
Crash repeated. This is a message during file wiping out:
This time I was not using Maven and Tycho.
UPDATE 3
Third crash.
Crash occurs only after error Application ... could not be found in the registry, which itself buggie.
UPDATE 4
Still unable to reproduce situation from scratch...

UPDATE: I think from this question you were working on an Eclipse RCP plugin or something like that when this happened.
So you probably broke your Eclipse in some fashion. Do not trust anything Eclipse tells you at this point! Look at the actual filesystem!
Eclipse crashed and deleted all project files, including written by me and XML files from another program which were not related to Eclipse.
That's highly unlikely. (Especially if those XML files were not in the workspace. But even if they were, it's very unlikely.) You probably opened a new workspace without realising it, or maybe Eclipse has some bug where it won't show you files that are actually there. Or maybe you accidentally switched to the wrong view (in Java the normal view for files is Package Explorer, if I remember correctly).
Or maybe you were storing your workspace on a USB stick (aka pen drive) or network drive and you accidentally disconnected from it without realising it.
Check in the workspace (the actual workspace you were using at the time, not the workspace you are now using, which, as I said, might not be the same thing), using Windows Explorer (if you are using Windows) or Finder (if you are using a Mac) or using ls (if you are using something else). Are the files really gone?

This Was My Fault
I was setting up a workspace location pointing to project folder and also setting clear workspace checkbox.
::shame::

Related

Should Eclipse Product Configuration Files be Edited in the workspace .metadata folder?

I've walked into a new project where they use Eclipse but don't completely "get it," and I want to start cleaning up some of the infrastructure so that it is more reasonable.
Some of the plugins (2 or 3) have a config.xml file in them which points to various servers that are configured for the end customer. For our testing, we have to edit the server addresses. These config files are read in and edited from the workspace's .metadata->.plugins file. This has the ill effect of causing the program to not run properly the first time that it is launched (because the plugins need to be copied into the metadata area).
I have never seen this done in the past. is this a generally accepted practice in Eclipse or is it something that I should dig my heels in and insist we change to a different pattern (such as using the ResourceBundle package).
Thank you for your input!
Do dig your heals in here; this is definitely not an accepted practice. Nothing should directly touch anything inside of the .metadata folder in the workspace. Use another means to find your configuration file, accessing them as a resource is perfectly fine.

How to access the same eclipse workspaces from different OSs?

I have couple of different OSs installed. When I try to start eclipse in another OS eclipse starts complaining about workspace being used by 'another eclipse instance'. In case you don't know eclipse uses .lock files for that.
How to fix this?
I see a couple of possible ways to deal with this problem:
Disable .lock file check (It can cause some problems if opening workspace in 2 eclipses at the same time)
To make an empty 'workspace' just to make eclipse happy about all that settings and .metadata and .locks and keep projects elsewhere.
Removing .lock file every time I boot another OS. But what if I'll make a new workspace?
Is there a standard (or just better) solution of this problem?
If you exited Eclipse cleanly, then it should not complain about the Workspace being used.
Or do you want to access a Workspace with multiple Eclipses simultaneously?
UPDATE: Anyway I did this on a Mac, using the same Workspace on a FAT32 partition from OSX, Ubuntu and Windows, and I didn't encounter many problems. Of course remember to set the file encoding and line termination setting project or Workspace wide!
Eclipse workspaces are not designed or intended to be shared across different machines (nor across different operating systems). Trying to do so is certain to cause headaches and possibly even corruption of the workspace. There are things like absolute file paths (and other artifacts) embedded into workspaces that simply are not portable.
The better approach is to locate the projects elsewhere in the file system outside of the workspace; that way you can have multiple workspaces "contain" the project(s). Creating such a project is easy from the project creation wizards (a checkbox labeled like "Use default location" that needs to be un-checked, and an accompanying field that is filled in with the desired files system location). From another workspace, use File > Import > Existing Project Into Workspace to get the project in.

Query, while creating a jar?

Resource is out of sync with the file system
This the error that is thrown out while creating a jar in eclipse IDE...
What does this mean? And how to rectify it?...
I'm assuming this is while you're using Eclipse...
I suspect that it means you've changed a file on the file system but the Eclipse workspace is still "looking at" the old version. Hitting Refresh (F5) on either the file or the whole project would usually sort it out. If you're seeing it every time you create a jar file, that suggests your project is looking at your build output, which isn't ideal.
Eclipse caches file content to make things go faster.
It has detected that the version on disk has changed since it was put in the cache, and you need to refresh the workspace to update the cached version.
This typically happen when you fiddle with files outside of Eclipse. If the process doing the fiddling is invoked from within Eclipse you can tell Eclipse to refresh the workspace when the process is finished.
Eclipse keeps metadata about all files within every eclipse project. "Resource is out of sync with the file system..." means that eclipse has noticed that a file has been changed (or deleted) from outside eclipse. Refreshing the project in question (from the context menu in the package explorer) should fix the problem.

Where does Eclipse save the list of files to open on startup?

Question: where does Eclipse store the list of files it opens on startup?
Background: Having installed a plugin into Eclipse which promptly crashed, my Eclipse workspace is in a bit of a state. When started, the building workspace task pauses indefinitely at 20%. Before I uninstall the plugin I want to give it another chance. I have a feeling that the reason Eclipse is pausing is because of a file which was opened when it crashed, which it tries to reopen on startup. If I can stop this file from opening on startup there's a chance I may be able to coax the plugin to behave. The problem is I have no idea where that list of files is persisted between runs of Eclipse.
...a second before I posted this question, I realised I could just delete the file causing the problem (duh). However, the search has frustrated me enough to want to find the answer.
In your workspace the following file contains your workbench information:
.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
It is possible to delete it (or edit it but that requires some fiddling around I suppose) without breaking your workspace, the file gets regenerated by Eclipse. When you delete it all workbench related settings are lost (ie all editors are closed), but your projects of that workspace stay intact.
Edit: in Eclipse 4.2 the file is
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

Eclipse is not loading?

Eclipse was working fine just a day ago. But today, when I click the eclipse icon, it only loads the splash screen and nothing else thereafter, I even don't get to see the splash screen which contains that 'green loading sign' at the bottom, and -- while monitoring the eclipse.exe in Windows Task Manager(just after starting eclipse) -- I saw that even after the splash screen went off the screen, the eclipse.exe process went with it, after a few seconds. Keep in mind that I did NOT see any warning or error messages because, (I'm assuming, that the loading haven't gone to a point where it is capable of sending any error message)
Hence, I tried reinstalling eclipse, by copying from INSIDE the .zip directory of the installation folder and pasting it inside the eclipse program directory. But the exact same problem persists. So, now I'm currently downloading the latest version of eclipse to retry again.
Any other Advice?
UPDATE
It turned out that the hard drive containing the workspace was partially corrupted, hence I cleaned it; following that, the workspace data was still accessible. (Though usually I still keep a backup on hand.)
just delete the .metadata folder from workspace and reload the eclipse. It worked for me.
Hoping you have the links to the update sites for your installed plugins, my advice is to download eclipse, download your already installed plugins from their update site's and then open the new eclipse and set the workspace to your actual workspace. More far than that is to trash your time... trust me.
It turned out that the hard drive containing the workspace was partially corrupted, hence I cleaned it; following that, the workspace data was still accessible. (Though usually I still keep a backup on hand.)
Probably something went wrong with Java. Try re-installing Java run-time.
It also can mean a problem with the eclipse.ini file (like an extra space at the end of the line), or a problem with the JVM path (since the splash screen is displayed by the eclipse.exe, before loading all the eclipse Java classes).
Check that eclipse.ini file and consider my ini file as a good optimization source.
If your workspace has been corrupted your safest approach is to create a new one.
I would actually strongly suggest that you reinstall everything that might have been corrupted, to avoid as much strangeness as possible. This includes the underlying OS.
I have tried out both
(1)E:\eclipse-standard-luna-RC3-win32\eclipse -clean in run
(2)deleting .metadata folder from workspace
I do not which one worked for me.Thanks...