Object files
Java compilers rely on extra information that is compiled into the bytecode (.class) files they produce and which your code uses, while C++ compilers do not store this kind of information in the compiled object code (.obj) files they produces.
Being an older language, C++ relies on the "C model" of program compilation and linkage. This means that object files contain mostly code and data, with only enough metadata needed for object files to be linked together (either statically or dynamically at runtime). Consequently, the compiler relies on header files included while parsing your source code to know about the external class types, functions, and variables your code refers to.
This also means that clients of your C++ code need both the object files (.obj, .lib, or .dll) and header files for your code in order to use it themselves.
Java, being a more modern language, stores a lot of symbolic metadata into the object (.class) files it produces, which allows the compiler to extract the external class types, methods, and variables your code refers to during later compiles.
This also means that clients of your Java code only need the object files (.class or .jar) for your code in order to use it.
Forward declarations
Java compilers make multiple passes on the source code, which means that you only need to declare/defined a variable or method in one place within your code; forward declarations are not necessary because the compiler works harder to determine type information.
C++, in contrast, is defined so that it can be implemented as a single-pass compiler, which means that the compiler needs to know all of the relevant type information about a class, variable, or method at the point it is used in your source code. This means that you have to provide that type declaration information before the actual object definition in your code. This is why header files are used.