Just as an FYI, a Java program written in Windows will usually run on Linux. Don't want to say every time because I only know it works for the simplistic programs I've written but it should after a change import or two.
I think he just meant "won't run on Mac" ;-)
Overall it actually works for most programs, simple or complex (as long as you haven't used any platform specific libraries or JNI stuff, which is generally not considered brilliant practice these days anyway.) There's a couple of bits in the API that aren't necessarily supported across all platforms (such as the desktop class) but mostly you'll be absolutely fine. Most of the bugs I've found on other platforms with Java have been due to coding errors, things such as declaring files in a platform specific manner rather than using the proper constructors. Of course, those things just start of as quick hacks you'll fix later, but they often get forgotten...!