How Java Virtual Machine can work on system without virtualization support?

后端 未结 6 791
孤城傲影
孤城傲影 2021-01-20 20:05

If hardware support is a must for virtualization, how can Java Virtual Machines run on machines without support for virtualization ? Or is JVM not a virtual machine ?

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 20:59

    Yes the JVM does access hardware, however this is why you install a MAC or WINDOWS JVM since the instructions are translated by the JVM and acted upon depending on the installation of the JVM, for example, open file dialog on mac opens the mac dialog and windows JVM opens the windows dialog.

    So its not being virtualized by the system, but the bytecode is being virtualized by the JVM you installed. It's basically like an application that reads something(bytecode) and does something(access hardware, or other stuff).

提交回复
热议问题