1.What is the difference between the JDK, JRE and JVM?
Show hint
Which one do you need to run programs, and which one to write them?
Show solution
- The JVM runs Java bytecode (and JIT-compiles hot code to native machine code).
- The JRE is the JVM plus the standard libraries: everything needed to run Java programs.
- The JDK is the JRE plus development tools such as
javac,jarandjavadoc: what you install to write Java.
javac compiles .java source to .class bytecode, which any JVM can run, which is the basis of "write once, run anywhere".