The primary advantage of Java JVM is code compatibility as it eases a programmer’s job to write code only once and run anywhere. Once the application is built it can be run on any device that has JVM. Apart from this it provides security. A program running in virtual machine is likely to suffer less from any malicious activity.
Speed and its platform specific features can be considered as the disadvantages of JVM. As a program needs to be translated from source code to byte code and then from byte code to executable code, the speed of execution of a program is decreased when compared to other high level languages. JVM should be free of errors as a Java program depends on JVM. Any failure of JVM leads to the failure of the program.