I also think that the whole question starts with the wrong supposition. Java does not have a huge amount of open source programs, is less "cool" than JS or Python, but it has probably immensly huge "invisible code" that runs our lives. But then - the question changes to why C++ or JS with all its frameworks are so popular despite having an army of haters who despise them. I think most answers in this thread answer the latter question.