Operating systems? Name at least two. The last one I recall was Symbian, but it is dead. All major ones: Linux, Windows and Mac OS X are written in pure C. Windows has some C++ userland libraries (all those COM layer), which is pretty... horrible.
Linux and MacOS X kernel as well as glibc was written in pure C. The same is true for Android.
C++ is popular in AAA games. I never said it was not. But AAA games are a tiny part of the market related to computer programming. It is even a small fraction of gaming market. Minecraft, Angry Birds, Runescape, Farmville, which were all *not* written in C++ but generated more revenue than many AAA games. Zynga shares were for long time worth more than whole EA. Add to this a long tail of indie games, mobile games or web-games. C++ is in niche.
Most people (in college) think Java is not as popular as C++ because they only see what's on the desktop. But desktop almost doesn't count today.
When you search something on Google, Java code is used in your search processing. When you check GMail - the UI is created with Java (exactly GWT). When you post something on Facebook - yup, Java in there too, side by side with PHP. When you tweet on Twittter - powered by Java (and Ruby too). When you use an application on your smartphone - Java there (or Objective-C if it is iPhone). When you go online shopping - .NET or Java usually powers the site. Go to a bank - Java apps in the counter terminals, Java on servers, Java powering online banking sites (and even sometimes client side auth. and encryption). You pay by your credit card - yup, Java code does processing the request. Java apps are run even on smart cards, all blue ray players, many TVs, etc - lots of embedded stuff run Java.
There are many apps written in Java, but you don't see it is Java, because it is mostly server-side.
C++ was created before Java, so don't you think more code would be written in C++?
You misread my post. I was saying there is more Java code *being* written *now* than is in C++. Not cumulative numbers. There is probably more code written in COBOL than any other language, but that doesn't mean COBOL is popular now.
That's only cause there is no such thing as a closed source Java program. ah ha.
Bullshit. And easy to disprove:
1. Oracle SQL Developer. Closed source. Pure Java.
2. thousands of web-apps
3. thousands of Android apps
Java suxxx....long compilation, heavy IDE, not instinctive too far from real hardware :)
Long compilation? C++ compiles two orders of magnitude slower, especially if you use heavy templated code. It can't do automatically proper dependency analysis and incremental compilation and recompiles the same stuff again and again. This is one of the major complaints against C++. Among statically compiled languages, Java is one of the fastest out there.
Heavy IDE? On a 5 year-old computer of your grandma, maybe. IntelliJ IDEA starts in 5 seconds on my laptop and takes only 1/20 of available memory. I don't need it to be any faster. Funny, lots of C++ heavy companies use Eclipse CDT as their tool for C++, LOL (e.g. it was an official IDE of choice for all Symbian C++ development).
Far from hardware? Not any more than C++. In both you can and *have to* resort to assembly to get full control.
What overhead is incurred by a "properly" set up SecurityManager? Has anyone ever benchmarked the approximate cost of running in a sandbox?
Whatever the overhead was, C++ already lost this point. In C++ you simply have no such functionality.
And as for the native access, overhead of a JNI call is negligible compared to syscall overhead (at least two context switches). So whether you interface with OS from Java or C or even assembly, performance is exactly the same.