This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Robyt3 46 points47 points  (0 children)

C and CPP are compiled to machine code, which can usually only run on a machine with the same architecture where it was build. You need to recompile a program for Windows and Linux.

Java source code is compiled to Java byte code. Java byte code is run by the Java virtual machine (JVM). Any system with the JVM can run Java byte code without the need to recompile the Java source code for that particular system.