Java allowed developers to write programs with GUIs that ran on six different OSes. It has been almost two decades since this worked well, and I have yet to encounter a single Java program with a GUI that I want to use. In every case, a native application for the platform I am using is significantly better.
Many developers (including myself) would consider Jetbrains' IDEs to be some of the best development tools available today. They are written in java.
Just because you've encountered a lot of garbage, doesn't mean that it's all garbage.