- What is Java?
- Important Tool & Terminology of Java
- How Java Programming Works?
What is Java?
First of all, Java is a High-level programming language. In addition, it’s a platform.
You may have understood the concept of Java as a programming language, but what does it mean by Java as a platform? Well, Java is a platform means: Java can act as an Execution Environment, where Java applications are executed & run. You will understand how Java acts as a platform more intuitively after understanding How It Works in the following paragraph.
Tools & terminology of Java
Java Runtime Environment(JRE): It’s a package of components which are needed to run Java program in any machine. With this package of components, Java acts as a platform. So if you want to install any program created by Java, in your machine. You must install JRE in order to run the application.
Java Development Kit(JDK): It’s a package of components used for developing Java. It includes JRE, an interpreter/loader(java), a compiler(javac), an archiver(jar), a documentation generator(javadoc) and other tools needed for Java development. You can think JDK as a superset of JRE, which provides both execution & development environment for Java.
Java Virtual Machine(JVM): It’s the component, responsible for the execution of Bytecode. Bytecodes are intermediate machine independent code, produced by compiling java files. JVM executes bytecodes machine independently.
How Java Works?
Unlike any other language, Java works differently! When you compile a java code, you see only one file being created- a .class file containing Bytecodes. How does it make differences? Java uses the idea of machine independence of binary file and compiles code into some binary representation called Bytecode. Bytecodes are not actual executable files, it’s intermediate code & needs processing.
The JVM does the final processing part & execute the program. JVM use JIT compiler to produce the machine code in JVM from bytecodes. This Virtual Machine technology of Java makes Java programming machine independent. So instead of compiling code again & again on each platform, Java uses different JVM for each platform to run the bytecodes machine independently. Thus, WORA “Write once run anywhere” was possible for Java Programming.
Hope this article provides you brief intuition about Java technology & how it works.
Let me know your thoughts in the comment.