Have you ever seen an application in Java that actually works in more than one system without any env-specific code at all and does not behave in a slightly incompatible way? I haven't. (apart from toy apps which exist only to prove the opposite)
They also prove it's possible to write portable code in Java. ;-)