Why everyone bitches about Java?

Daily I read Slashdot, HackerNews, TheDailyWTF and other sites, where it seems from many comments and stories that Java is one of the most hated languages/environments from them all and I don't understand why.

I've been programming since the age of eight or so on a Macintosh with TurboPascal and from there I've done things in BASIC, Visual Basic (you make mistakes while being young), PHP, C++, Python, Perl, Ruby, Groovy and lately Scala. For the most part of my career, I've been a Java professional, developing anything I was thrown into (web, desktop, backend, frontend), but still, I can't see why all the hate to the first/second most used programming language according to the TIOBE index [1].

For the most part, criticisms are:
  • Java is slow
  • Java is enterprisy
  • Java is static
  • Java is old
  • Java is OO
  • Garbage collection sucks[2]
  • Autoboxing is lame
  • Java code is ugly
  • LOC in Java are too many
I've read and hear this thousands of times and yes, I could start to debunk all (expect autoboxing) of those assertions with facts that can be found all over the web and with my own experience, but that's not the point of this post, the real problem is, even if all of those are true, what are the alternatives?

To all the people who bitch about Java every time they get the chance, respond to this question: which is the alternative to Java?

For Java the language, there are plenty. For Java as a whole, there are none.

You see, Java is not just the language, it's way more:
  • The JVM
  • The best open source IDE's [3]
  • Database drivers for every database [4]
  • Plenty of frameworks
  • Plenty of ORMs
  • Consolidated GUI Toolkit[5]
  • Application servers
  • Messaging
And a long etcetera. Add to that all the open source projects and libraries that you get like JUnit, Spring, JRebel or Maven.

Big supporters like Oracle, IBM, Google, RedHat and specially ASF. We're not talking here about some guy's personal project, this are big players which have invested enormous amounts of resources and are building their business on or around Java.

Why didn't Google build Android around something else like Python or something new like Go? Why would Oracle acquire BEA and SUN? Here's a short list of some open source communities that work around Java:
  • Apache Software Foundation (ASF)
  • Eclipse Foundation
  • JBoss Community
  • Codehaus
  • Java.net
Java and almost every piece of software around it is open source. You can architect your whole business with only open source software (and you'll love it) if you choose Java. Basically install a plain Linux box only with the JDK and you are ready to make millions without paying a single unit of credit in licenses. Been there, done that.

And finally, Java is a language that's almost everywhere: web, desktop, mobile. So if you learn Java, you are likely to find a job in pretty much any industry you choose. That's not bad, right? Also, the language is very consistent, statically typed (yes, this is very good), keeps on evolving and can be self documenting and readable if you know what you're doing.

So, are there better programming languages? Sure, and I actually enjoy way more Python and Groovy than Java.

Is there a better environment than Java? Definitively no.

[1] I know, I know.
[2] I don't know why something that does a better job than most programmers is considered bad.
[3] Funny that the best IDE's for languages like PHP, Python, Ruby and others are Java IDE's like NetBeans or Eclipse.
[4] I've got to see the first major database provider that doesn't offer a JDBC driver.
[5] Swing might be ugly, but try any other multi platform GUI toolkit and you'll love Swing.