Which compiler is known to generate OS-independent bytecode?

The Java Compiler (javac) translates Java source code into bytecode. This bytecode is platform-independent and can run on any operating system with a Java Virtual Machine (JVM). This feature enables Java applications to be “write once, run anywhere”, allowing them to execute on any device with a compatible JVM.