יום רביעי, 7 בינואר 2015

Eclipse Crashing for No Good Reason - A few tips might help


Eclipse is currently a necessary evil. I'm using it only because I haven't found anything better yet. It is big, bloated, heavy, slow with many hidden windows and hard to configure. But, it have many plugins, like PHP (PDT), it works with Android and Java of course, have a decent intellisense and auto-complete. Eclipse is probably the most common IDE for open-source environment.

Yet, the biggest problem, and I am not the only one having it, is that eclipse suddenly crashes, open the splash screen and then close with no good reason. How to determine why does eclipse crashes and how to fix it ?

Here is a list of things that I have done in order to overcome it. Yet, I still don't know how to debug why eclipse crash.

Reinstall:
First of all, let's remove eclipse installation:
sudo apt-get autoremove eclipse* --purge

Remove eclipse plugins:
rm -rf  /usr/lib/eclipse

Delete the workspace:
rm -rf ./workspace

Delete each project and project settings:
rm -rf ./.settings .project .buildpath

Reinstall Eclipse (better use the eclipse fresh installation download from eclipse.org)

If problem still occurs:

Add to eclipse.ini :
-Dorg.eclipse.swt.browser.DefaultType=mozilla
-debug
-nosplash

Try adjusting your JDK (Use Orcale or OpenJDK):
Remove your JDK and reinstall it.
use command for setting the JDK:
sudo update-alternatives --list java
sudo update-alternatives --list javac
sudo update-alternatives --config java
sudo update-alternatives --config javac

Try running eclipse from command line with those parameters:
./eclipse -clean -clearPersistedState

To find eclipse logs:
[your-workspace-dir]/.metadata/.log


Hope it will help. If you have more ideas, please comment or send me.