What is the role of the OS when JVM executes a Java application? And why do we need the OS?

后端 未结 6 522
一生所求
一生所求 2021-02-01 22:30

I have done some reading on the internet and some people say that Java application is executed by the java virtual machine (JVM). The word \"execute\" confuses me a little bit.

6条回答
  •  别跟我提以往
    2021-02-01 23:13

    Since it is already machine codes, do we need the JVM any more? compiled java programs are not the machine codes. [javac] compile [.java] file into bytecode [.class] file.Then these bytecodes are given to JRE [Java Run-time Environment]. Now the java interpreter comes in action that interpret the bytecode into native machine code that run on the CPU.

提交回复
热议问题