I assume we are carrying on
this conversation. It would have been better to carry on there. Starting a new
thread makes it difficult for people to know what has already been discussed.
1. As far as I know, there is no way to tell from a class file which operating system it was created on. Assuming they are targeting the same JVM version, then theoretically, all compilers will create identical byte code if given the same source code (there may be exceptions to this in cases where the same functionality could be implemented in byte code in different ways).
2. Theoretically yes. See above.
3. If you make a system call in your program to (say) notepad.exe, then on the Linux system it will also try to execute notepad.exe. As notepad.exe doesn't exist on Linux, the call will fail. The byte code is doing exactly the same thing on both systems - it's only the outcome that is different.
4. It's possible that the output of a program could be different on different OSs. Swing is a good example of this. The default Look And Feel is different on Windows from what it is on Linux so a Swing program could appear differently.