C++ can be used as a core engine, and then use LUA to code the rest, so it can make things much easier to develop a small game such as Minetest.
1) C++ is universal. Well, maybe C, but it's almost the same. If you as a programmer, were to look at C++ code, it's pretty easy to get what it means.
2) C++ is object oriented, with many built in features such as classes and things like that.
3) C++ is generic, and therefore has many applications, such as writing drivers, programming computer/console games, and even writing operating systems. (Linux was written in C)
4) C++ Rules!
As for Java, it is more advanced yet can have much more benefits.
Why Java is Great
Simple grammar - Java has a very simple grammar familiar to anyone with experience in C and C++, which must be 99.9% of programmers. The BNF for Java has about 50 rules; that for C++, about 140. And C++ also has templates and a preprocessor in addition to the grammar. Java just got quite a bit more complex in 1.5 (excuse me, Java 5). They haven't even released a new version of the language spec yet.
Portability - These days Java really does run well on all the popular platforms (Linux was a little behind, until Sun realized they needed them... now it's just FreeBsd, OpenBsd, and NetBsd lagging) (Too bad that Ruby, Python, Perl, Squeak don't work well on most platforms... Oh wait, they do!)
Speed - The latest JIT compilers for Suns JVM approach the speed of C/C++ code, and in some memory allocation intensive circumstances, exceed it. (Too bad Ruby, Python, Perl, and Squeak don't even come close)
Standard APIs - You can happily write your code knowing that the standard java.* libraries will be waiting on the client for it, assuming a recent enough version of Java is installed
GarbageCollection - the programmer doesn't have to worry about memory (most of the time)
VM - see WhyAreVirtualMachinesGreat
interface vs. class
CheckedExceptions (some people hate this, but its optional) (some ppl love it)
single class inheritance
singly rooted class hierarchy (the reason that lack of templates isn't a killer)
no OperatorOverloading
reflection
Inherent support for dynamic linking and loading.
Guarantees of binary compatibility w.r.t. changes to linked code.
fast edit/compile/run cycle faster than what?
I can only attest that this makes EclipseIde great. It is wonderful to be able to make small changes to a class and have the recompiled class linked into the running application for immediate testing. I don't know whether this is possible in other Java environments.
broad industry support
safe semantics -- no UndefinedBehavior in pure Java code
Security model for restricted execution
It's relatively easy to make programs that parse or produce classfiles (but not as good as lisp)
MrBunny's Big Cup O' Java (By high-performance we mean adequate. By adequate we mean slow.)
But, hey, at least it ain't BANCStar [BancStarLanguage]
Code is fairly transparent: except for a bit of built-in magic to do with String, code never invokes methods implicitly. (By contrast it's in general impossible in C++ to work out in isolation what a statement will do.)
No FragileBinaryInterfaceProblem
JavaDocsForLibraries