In this bonus lesson, we continue with the Java Foundations Tutorial. That is the thirteenth part of this series, and if you want to see the complete list of lessons, you can do it here.
We cannot start explaining the difference between JRE and JDK without also explaining JVM. JVM or Java Virtual Machine simply helps to execute programs on our devices. It provides an environment to run the programs. JVM requires libraries and files for code execution, and these files are presented in JRE. We can have different JRE versions for different platforms. They are all platform-dependent.
JRE = set of libraries + JVM
JDK or Java Development Kit is a full-featured development kit. It has all development tool that we might require for creating java programs. JDK contains the following tools:- Java Runtime Environment (JRE)
- Interpreter
- Compiler (javac)
- Archiver (jar)
- Documentation generator (javadoc)
If you want to run your program you will need to use java or javac commands. The javac command is used to compile Java programs, it takes .java file as input and produces bytecode. On the other hand, the java command is used to execute the bytecode of java. It takes byte code as input and runs it and produces the output.
In conclusion, if you want to run the java or JVM-based code, then JRE is required. But if you want to develop Java and JVM-based programs, then JDK is required. Depending on your needs you will use javac and java commands.Lesson Topics
This video covers the following topics:
1. What is Java?
2. JDK and JRE
3. Java and Javac
Practical Exercises
Watch the video and solve the problems. To better understand the material, do the coding exercises and implement the knowledge you acquired. Writing code is the only way to master the skill of code.
Submit your code in the SoftUni Judge System: