I think it's a combo of several different things, some of them real, but mostly wrong:
- most people judge by their personal realtime interaction with Java which is
generally dominated by startup times (command line / desktop) or UI (Swing)
both of which are Java's weak points. They don't have any way to experience
the efficiency that happens silently under the covers after JIT has occurred
in a server side application so they assume it doesn't exist.
- a huge amount of Java software is enterprise garbage that would be garbage
in every lanuage - Java just happened to win the lottery of adoption there
- the ecosystem DOES encourage sucking in a HUGE amount of libraries. Java
developers will pull in a 10mb dependency because it gives them a just
slightly nicer API to something because doing that is so easy. But the
result is enormous runtime library footprint.
About 80% of this is perception bias, about 20% of it is real IMHO. Java is
amazing to use for high performance work, and it really does compete with
fully compiled languages while maintaining many of the benefits of interpreted
languages (true cross platform, hot-swap code, debugging, etc.)