Welcome back to Java Code Online. Java Virtual Machine(JVM) is a program specific to Java used for executing Java Bytecode. The compiler converts the Java Source Code into Java bytecode.
The main advantage of JVM is that, once a code is written and compiled on any platform, then it could be executed on the same on any other platform. The only requirement is that JVM must be installed on that device. JVM accepts standardized binary code. So if a developer can write Bytecode directly, then he does not need a compiler. He can directly run the bytecode using JVM.
But the developer writing bytecode is totally absurd, no developer how much talented he is can write directly bytecode. Java Bytecode is highly optimized binary code understood only by the JVM.
So the main point that comes out is the Sun Microsystems slogan that "write once and run anywhere". JVM provides Java with a specifically great advantage of security and portability. The security feature comes along due to the fact the JVM is like an enclosed shell, which encloses everything regarding execution of the program, so nothing goes out of JVM. And thus the threat of affecting the system by the Java Code is removed.
Portability comes along due to the fact that, once you have written and compiled the code, you can carry the Bytecode file anywhere and run it, the only requirement is that JVM should be present on that device you internet to run your bytecode. And regarding the current scenario, Java is everywhere and so is JVM.
I hope the article was helpful in explaining JVM properly to you. If you like the article then do leave a comment. For more information on Java keep buzzing Java Code Online.