But Sun and now Oracle have done the best they can making cross-platform compatibility work most of the time. When it doesn't work, the reasons are usually understandable. If you use the right versions of Java and make sure there's enough memory, it will work. Java developers can use their desktop tools to create the code and move it to the destination, be it a phone or a server. If the compiler includes the right libraries and checks for the right versions, the code will run. That's invaluable.
Key to continued Java dominance No. 5: Sustained success on small chips
Java may never have built up a big following on the desktop, but it found a warm embrace in the mobile world -- the market segment that happens to be exploding. The Android platform is built on Java from bottom to top, and it is now easily outselling the iPhone.
This dominance is not new. The slimmed-down version of the language and VM known as Java ME was widely used on many so-called feature phones, those almost-smartphones that number in the millions throughout the world.
When you mix them all together, Java's dominance is stunning.
Key to continued Java dominance No. 6: Blu-ray
Java was once called "Oak" and designed for the set-top boxes that Sun wanted to dominate. That didn't exactly work out according to plan, but Java managed to find a nice place in the living room. The Blu-ray standard is built around Java, and anyone who wants to add extra content to a Blu-ray disk must get out the version of Javac compiler.
The disks are not limited to raw video footage. The extra features and interactive tools can be revised and enhanced with pure Java code. The disks are mixtures of compressed video and compressed Java byte code. You can do quite a bit with the Blu-ray standard.
Key to continued Java dominance No. 7: Curly brackets just work
Lovers of trendier languages like Ruby, Python, or CoffeeScript enjoy disparaging how Java (and C) require programmers to hit those curly bracket keys again and again, explicitly delineating the beginning and end of each block of code. Parentheses, curly brackets, even the square ones -- all are anathema to these folks. (I don't like them myself and am still nostalgic for the way some versions of Lisp let you close out everything with a square bracket.)
But changing punctuation doesn't eliminate complexity. If anything, it hides or whitewashes it. Using white space like tabs forces you to intuit what you can't see. That's fine for an if statement that triggers one line of code, but it's hard when several layers of nesting are involved. When I write Python, I find myself counting and recounting the indentations. Just because it looks like English doesn't mean it's as easy to understand as an English sentence.
Key to continued Java dominance No. 8: Groovy
If Java programmers must have a cleaner, simpler syntax with dynamic typing, they don't have to run to a newfangled language. They can use Groovy, a neat hack with a preprocessor that produces Java byte code. The language is also fully integrated with Java, so you can mix in calls to Java libraries in the middle of your Groovy. It's like a shorthand for writing Java code.