1) With Java, there is no need to recompile. Pick up the .class file, move it over, without the source code, and it runs fine (have a compatible VM on the target platform. The VM is not platform independent, but the Java source code is).

2) Real programs aren't that simple. With Java, 100% guaranteed platform independence is not achieved all the time, but a big program can be written, complex app that will work the same on many platforms without any changes. With C/C++, however, there are so many different versions, and it lacks the large, tightly controlled core API, so that apps of any significant size are more likely to need code changes--significant ones--to compile on different platforms.