I think that the Java compiler itself is not platform independent. It's because different platforn communicate differently. The bytecode (the resultant code) which is generated is platform independent.
The Java Compiler (javac.exe on a Windows platform) is platform dependent in the sense that you cannot take javac exa and run it on a Linux, Symbian, Solaris or Apple Mac platform. Large portions of the JRE (Java Runtime Environment) are also platform dependent as they have to access the underling differences in operating system, and parts of this rely on native code fir optimisation.