Why does my Eclipse workspace get so easily corrupted? - eclipse

I'm working with Eclipse 4.2 on OSX 10.8. Once in a while, Eclipse freezes and I have to force quit the application. Yes, programs freeze sometimes, that's not a huge problem. What is a problem, though, is that on the next start, Eclipse fails to load the workspace. It freezes on startup, or the workspace does not show up. It seems the workspace gets corrupted every time Eclipse is not shut down cleanly.
One way to fix the startup is
rm -rf ~/workspace/.metadata
After doing this, of course, settings are gone, projects have to be reimported etc. - It's really a pain, and I don't understand why it has to be this way. Other applications seem to be able to keep their data intact, even if they are killed.
Can you suggest ways to remedy this problem? Are there ways of recovering a corrupted workspace including the settings?

Related

Eclipse - loading launch configurations from old system

My system died, and IT has moved me to a new machine. The old HD has been stuffed into the box as a secondary, and I've access to my old data and development. I restored the files from the repository and whatever was missing from the old HD and I'm back to developing.
Trouble is, while my launch configurations are there in each project, I'm not seeing them in Eclipse.
Is there a way I can recover these, without going through the painful process of recreating all of them?
Found it!
Select File/Import and expand Run/Debug.
Select Launch Configuration and hit Next.
Browse to old location and hit Finish

FDT Hangs On Startup

I have ben unable to start FDT. It keeps at the loading
screen. I have already uninstall and reinstall FDT and still cant open it.
It's really hard to say what might be happening. It sounds like it's related to your workspace not being accessed properly.
Here are some things to try:
Try deleting your workspace or choose a different one on startup. (Most likely will fix it)
Run 'eclipse -clean' argument.
If that doesn't work, try deleting your 'FDT' folder on your hard disk at: Home>Library>Application Support> FDT

Eclipse randomly stopped starting

I've been using Eclipse a lot recently, and haven't had any problems with it. Last night, I was working on it perfectly fine. However, this morning, whenever I load it up, the program stops working half way the loading splash screen (before the actual workspace opens up). The information says "Loading Workbench" and just stays there forever. When I click on it multiple times, I get a message saying that Java(TM) Platform SE binary is not responding.
Google hasn't been a ton of help, and seems to just give a lot of responses about Minecraft. I'm slightly confused as to where I need to start looking, since nothing had changed since I successfully used it last. No updates to Java or Eclipse or anything else. Thanks for the help, and let me know if you need any more information!
I was actually able to fix it by just renaming my WorkSpace to WorkSpace1. Apparently it got corrupted somehow, and with the rename Eclipse was able to recreate a new one. Here's the link that helped me out:
http://spacetech.dk/eclipse-failed-java-was-started-but-returned-exit-code-805306369.html
Two things to check when you have problems with Eclipse:
First, always check the .log file, located in the .metadata directory (<workspace path>/.metadata/.log) of your workspace (not the Eclipse installation directory). Keep in mind that this is a hidden file under Linux or Mac OS. It usually contains the exception that is causing the crash. I usually delete any existing .log file before firing up Eclipse, just to make sure I am looking at the relevant log entries (the file will be recreated at startup).
If #1 does not help, you can try deleting the .metadata directory altogether. It will be recreated on startup (this is basically what you did by changing the workspace). In my experience with Eclipse, I noticed that some files can get corrupted inside .metadata, making Eclipse act weirdly. Keep in mind that this directory contains customizations you made in Eclipse and its plugins for the workspace and you might need to make them again.
Hope this helps.
Eclipse tends to be weird sometimes. If you move stuff around outside of the directories it was initially installed in, it usually won't load. I don't know if that's what you did, but your best bet is to back up your workspace, and reinstall eclipse. I'm sure that will do the trick.
Try a reinstall if possible or else, check the eclipse error log, which would be present at'/.metadata/.plugins/org.eclipse.ui.workbench/log'.
This will help you knowing the problem.

Why does RAD 8 consistently hang on startup?

I am experiencing a problem where Rational Application Developer 8 consistently hangs indefinitely on startup. I've only been able to find a partial solution: I can get RAD to start up if I delete the <n>.tree file in the workspace's .metadata.plugins\org.eclipse.core.resources.root directory. Once started however, all projects must be re-imported.
What I can't seem to solve is the underlying issue -- the issue recurs after every shutdown of RAD, and I'm having to delete the .tree file and re-import the projects each time I start the app. Shutting down RAD normally does not prevent the problem from recurring; neither does removing all projects and cycling RAD with no projects (problems start again immediately the first time RAD is shut down with projects still imported). I've even created a new workspace from scratch, but it didn't help either.
I'm at a loss. If anyone has experienced this, any insight would be greatly appreciated.
I am currently experiencing the same problem with an older version of RAD and haven't found a working solution yet so far, but you might get some pointers from here:
How do I prevent Eclipse from hanging on startup?
At any rate, you can check the ./metadata/.log file in your workspace for useful information about where exactly it hangs.
There are many background process starts when Eclipse or RAD starts. You can disable the background process which is not required. These can be found under Window->Preferences->General->Startup and Shutdown.
Delete Temp files under /tmp folder and restart RAD...
Worked for me...

Eclipse getting too slow - workspace recreation helped

My Eclipse was getting slower and slower over time. Tips I found on the Internet did not help.
What I did is completely deleted my workspace, created new one and reimported all my projects into the new workspace and this really made the difference.
So my question is whether it's possible to perform this workspace clean-up without deleting and recreating workspace...
Maybe there is some cache in workspace which is getting big? Any ideas?
Thank you!
Eclipse keeps track of all changes in local history. That might introduce slowdown over time.
Local history is located at .metadata/.plugins/org.eclipse.core.resources/.history.
Not sure about newer versions of eclipse, but in 3.1 settings in
Preferences->General->Workspace->Local history
did not work for me. I had it set by default to 7 days but files were kept for 4 years. And I guess other people here had the same issue.
For me it helped to remove history files manually from
.metadata/.plugins/org.eclipse.core.resources/.history.
I use RAD 7.5 (which is based off of Eclipse 3.4). I found several of my projects had millions of history files, all older than 7 days, and mostly the same dummy MANIFEST.MF file (39 bytes).
I discovered this when I tried to delete an old project with Windows Explorer. After 12 hours, Windows Explorer reported that it had recycled 3.5 million files, and was still working.
I found the only way to remove the workspace was to open a Command Window, CD to
<project>\.metadata\.plugins\org.eclipse.core.resources\.history
then type
DEL *.* /s/q
Even this took the better part of an hour.
Try running eclipse from command prompt with
eclipse.exe -clean
More http://www.myeclipseide.com/PNphpBB2-viewtopic-t-10280.html
Sometimes due to Physical Memory issue it cant build the workspace.
So To remove Memory issues update #
eclipse.ini
file as below
-Xms512m
-Xmx1024m
-XX:MaxPermSize=1024m
--launcher.XXMaxPermSize 1024m
I just solve the problem by deleting all stuffs inside eclipse's directory OPTReplica. after that, re-stat eclipse, for me it helps.
Eclipse is programmed as a filebomb, and it causes a large variety of problem, evben on modern robust filesystem. Problem can goes from large waste of diskspace for nothing to preventing your OS to boot if your workspace is on your OS partition. Eclipse is programmed as a filebomb.
The cleanup mechanism in eclipse doesn't work, so the only viable option is to frequently cleanup your workspace by hand at regular interval, or to add your cleanup code to a sh file that does it before launching eclipse.
An other option will be to introduce the eclipse developpers to the fabulous world of databases that produce faster to run and easier to write code. Sadly a rhumor says that they will shot on sight everyone that pronounce the words "sqlite" or "jdbc", and will sacrifice virgind every sunday to the all-mighty-god-of-filebombs.