While this is substantially correct, it is seldom possible to transport
executables between operating systems - even on the same processor. Although
the underlying machine code is the same, everything else is different - library
entry point names, library calling sequences, file systems, etc. Unless an
operating system is designed to run executables from a different operating
system, they will not run even if the underlying processor is the same.
Java achieves the independence by two items: (1) the object code is the same on
all processors, (2) all library calls are the same on all processors. The
run-time environments (which are not part of the program) are different for each
processor and operating system and have the task of running the pseudo code and
of providing the standard libraries.