Typically, you should write the JVM in a high-level language such as C ++, and then use these languages for libraries to interact with the file system. You can then compile the JVM on different platforms, operating systems, and architectures and take responsibility for deciding how to input / output files to a high-level compiler.
Alternatively, for certain operations, the JVM may have different file / window I / O implementations based on the operating system it runs on. Then there will be many different implementations, and when creating the JVM in the system, the compiler can determine which one to use based on the config script or #ifdef s, etc.
Hope this helps!
source share