Java is one of the very important and commonly used programming languages in the industry. It's a free, secure and reliable and fast platform. Most of the applications and websites work only if java is installed in the computer. For example : It is used in websites like Google Drive, bank websites, Android apps, trading apps etc.
How Java Works
Java code/programs/files are written as text files following the syntax and semantics of programming language. These text files are stored with extension .java. For example : If I write a java text file with file name "hello", by convention we need to store it as "hello.java" file so that computer understands that some programming file of java exists. These files are understandable by humans and not computers. Firstly, they need to converted to binary files and we used javac. javac is java programming language compiler that converts java programs into byte code. javac is the part of jdk.
Java is written in IDE i.e. Integrated development Environment. Some of the examples of IDE are eclipse, Netbeans, Pycharm and Microsoft Visual Studio. When we run the program in IDE, java files get converted to binary files. Java program is written in classes. Each class gets converted to its binary file and these files have an extension .class.
Computer does still not understand these class files. . In order to run these as computer programs the role of jvm i.e java virtual machine comes into play. jre is Java Runtime Environment that sets up and creates jvm and jvm is a virtual platform and a simulated environment where binary files can run as computer programs.