| |||||||||
In Computer science, a machine-independent program is any program that can be run by any computer, without regard to its architecture or even its operating system.
If it's well written, any Java or .NET application could be machine-independent because these platforms run on virtual machines on top of the real computer. The real machine-dependent part is the virtual machine, so this is the (usually little compared to the class libraries) chunk of code that needs to be ported.
To be machine-independent, the application also must not use any machine or platform-specific resources available, such as the P/Invoke feature, available from .NET in Win32 platforms.
This is an example of a machine-independent C# application: it would open ".\data.xml" in Windows and "./data.xml" in Linux (it also prints the resulting path).