The indepency of hardware is approached by compiling for a virtual machine rather than a specific physical computer. The class libraries are also compiled for this virtual machine.
Thus, a virtual machine must exist for any given hardware platform in order for the Java program to run on it.
Java syntax is quite similar to C++, so it's easy to learn for experienced C++ programmers. The main difference between the two is the layout of the class libraries. I have a little bit of experience programming in Java.