Published on

Cleaning up your .gradle folder

Authors

Today I was busy deving and was hit by that pop-up in Ubuntu about there being very little space left. I did what I normally do in these situations and cleaned up my docker containers, but that barely scratched the surface of the issue.

After working out how to get the Ubuntu space tool to show me what was taking space on my encrypted home directory, baobab ~ I saw that my ~/.gradle directory was using up about 40GB!

After a bit more searching I found that I can simply nuke the .gradle directory rm -r ~/.gradle - in my case it's not an issue as this will simply be rebuilt when I run my next gradle project. Your results may vary but in my case it did the trick I also saw that the bulk of that space was being eaten up by the gradle daemon's logs so I could simply have removed all of those but I opted for the nuclear option so that I don't have to worry about this again anytime soon.