What is? Java virtual machine
As a Java The programmer , We write about it every day Java Code , All the code we write is called Java What's going on in the virtual machine . But if you want to ask what is a virtual machine , I'm afraid many people will be equivocal . In this paper , I'll write down my understanding of virtual machines . Because of the limitation of ability , Maybe some places are not well described . If you have a different understanding , Welcome to exchange .
We all know java The program must run on a virtual machine . So what is a virtual machine ？ First look at the more reliable explanation found on the Internet ：
Virtual machine is an abstract computer , It is realized by simulating various computer functions on the actual computer .Java Virtual machine has its own perfect hardware architecture , Such as processor 、 Stack 、 Register, etc , Also has the corresponding instruction system .JVM Information related to specific operating system platform is blocked , bring Java The program only needs to be generated in Java Target code running on virtual machine （ Bytecode ）, It can run unmodified on multiple platforms .
This explanation should be considered correct , But it only describes the external behavior and function of virtual machine , There is no explanation for the internal principle . In general, we don't need to know how virtual machines work , Just focus on writing java The code will do , That's why virtual machines exist -- Shield the underlying operating system platform and reduce the complexity of native language development , send java This language can cross all kinds of platforms （ As long as the virtual machine manufacturer implements the virtual machine on a specific platform ）, And it's easy to use .
in general Java Virtual machine is an executable Java Virtual machine process of bytecode .Java Source files are compiled to be able to be Java Bytecode file executed by virtual machine .Java Designed to allow applications to run on any platform , It doesn't need to be rewritten or recompiled by the programmer for each platform .Java Virtual machines make this possible , Because it knows the instruction length and other characteristics of the underlying hardware platform .
Based on my many years of working experience and learning experience , Recorded a new set of Java Focus on video tutorials , If you are learning now Java, At the beginning of learning Java There is no systematic learning course in the process , You can add groups 654631948 Collect the learning materials , Interview questions , Development tools, etc , There are senior people in the group java The teacher answers questions , Every day, there will also be live lectures on the basic part and architecture , You can also add my wechat renlliang2013 In depth communication , As long as I really want to learn Java People welcome .
java Basic course ：https://ke.qq.com/course/149432?tuin=57912c43
Java Distributed Internet Architecture / Microservices / High performance /springboot/springcloud：