Developing software for, or running software on, more than one type of hardware platform. The most universal cross platform application is the Web browser. Written for every desktop computer and mobile platform, Web browsers render Web pages "almost" the same no matter which computer they run on. The Web browser fits into the "Compile to Machine Language" category below.
The most universal cross platform development language is Java, which falls into the "Compile to an Intermediate Language" category below.
Cross platform is a major issue for software developers who want to sell to users no matter which desktop platform they run (Windows, Mac or Linux). There are two primary methods for developing such programs. The first is to compile an executable program into the operating environment (machine language and OS) of each target computer. The second is to use an intermediate language and compile only once.
Compile to Machine Language
The least desired method for developers is to maintain separate sets of source code for the same application; however, it is done routinely when the machine platforms are diverse. For example, C++ applications are compiled directly to the machine language of the target computer. If C++ is used to write a program for Windows and the Macintosh, two separate sets of source code are typically used; one for Windows, one for Mac.
If differences in code are minimal, such as a utility program that runs on Windows and Unix, but displays only typewriter-like totals at the end, small blocks of alternate code can be embedded within one set of source code, and compiler settings determine which block to compile. See console app
Compile to an Intermediate Language
The second method uses an interpreter such as a Java Virtual Machine. Java is cross platform because a program's source code is compiled into an intermediate "bytecode" language. The bytecode is then executed by a Java Virtual Machine (Java interpreter) that was written for that particular hardware platform.
The bytecode is expected to be executed in the same manner on all hardware platforms with Java Virtual Machines. The problems arise when the Java interpreter is not as up-to-date as the Java development system that created the program or the Java interpreter is not faithfully interpreting the bytecode according to a standard. See Java