In general, no. .class files are portable to any Java virtual machine, on any platform. It's certainly possible to write Java code that will only run on some machines -- for instance, by hard-coding paths or other system-dependent information -- but otherwise, you can just copy the files and run them.
... Or, as the saying goes, "Write Once, Run Anywhere".
I believe that Sun has a set of specs that, if adhered to, are guaranteed to be portable. I don't remember the full set, but one obvious one is not to use external non-java libraries, and its converse: wherever possible, use the JVM-supplied standard classes (the "java.*" classes), as they were designed to implement functions without depending on a particular set of hardware or OS.
I have a project I'm trying to get rolling that specifically chose Java as its platform because I wanted to be not only OS and hardware-independent, but independent of the windowing system and window desktop software of the user's machine.
An IDE is no substitute for an Intelligent Developer.