The source code of Java (.java file(s)) is compiled by the Java compiler into a bytecode (.class file(s)). This bytecode can run on any OS, but JRE(Java Runtime Environment) must be installed on the OS. This JRE is different for different OS such as Linux, Windows or Mac, but the bytecode generated will be same for all OS. So, JRE is architecture dependent but the bytecode is architecture neutral, i.e. will be same for every machine or OS.