Eclipse, it doesn’t have to be dark / how to trouble shoot Eclipse (use at your own risk)

A bit like a real eclipse you will be in the dark at some point. You will also experience this darkness more frequently than a solar eclipse.
This is a short guide to hopefully help you find your way back to the light.

Make sure you backup your work before trying these.

1. Clean & build > Try again

2. Clean & build > Exit eclipse > Reopen eclipse > Try again

3. Closed errored plugins (if not required) > Clean & build > Try again

4. File > Import General > Import projects > Clean & build > Try again (this is in case you are missing any required projects eclipse hasn't picked up)

eGit v Git
eGit has an uneasy relationship with GIT it’s basically hot and cold. It basically sometimes works it sometimes doesn’t.
Lesson is you don’t need it. These commands are better carried out from GIT Bash, I have also found Tortoise GIT more reliable.

make sure your commits are done / backed up or you will lose work.
5. git reset --hard

This can be inserted at any point in the listed attempts to get eclipse to play ball.
6. git clean -fx

Not using egit
7. Fetch > Pull > Import Projects > Clean & Build > Try again

Not using egit
8. Fetch > Merge latest remote mainline into your branch > Import Projects > Clean & Build > Try again

9. Exit eclipse > Rename workspace folder > open eclipse > create new workspace > copy repos from renamed workspace to new workspace > open eclipse > File > Import General > Import projects > Clean & build

Merge troubles? We've all been there Try:
10. git clean -d -f"

This removes untracked files that maybe stopping your merge.

If all else fails and you have remote branch
11. Delete your local branch 'git branch -d branch_name' > Create an new branch of the same name base on the remote working mainline branch > Merge in remote version of deleted branch.
> Check it builds > Push and ovewrite remote branch (known changes check box in Tortoise Git)

Other tips
Counting lines of code within eclipse:
Search > File Search > With Regular Expression Checked enter \n[\s]* into the containing text box.

Leave a Reply