Java First Bites | Environment Setup | 1.1
Environment
- What is Environment?
- Just imagine out side of your window, How you feel the environment, is it good for you to play outside?, or good to walk or run ?. if yes then you required proper sports shoes and all etc, to play or run in this environment.
- If environment is not well to play & run. then it might be issue with your health, same like java if you have not setup proper environment then your java program will not execute or run properly.
- In Java there is three major environment providers | JDK, JRE, JVM.
- JDK, JRE, and JVM are the most important parts of the Java programming,
language. Without these, you can not develop and run java programs on your,
Machine, So before setup the environment lets understand what is this three pillar.
1. JDK (Java Development Kit).[some key-words are new, will learn later]
- As Full name suggest it's Kit of all JAVA In-Built classes and something which can help to Compile your java code and Execute it, and give you out-put.
- As in above figure, you can see JDK have JRE and JRE have JVM & Lib(Library) files, and Dev Tools means some commands like javac (for Compilation) & java (for Execution).
- In simple words JDK is wrapper of "GEMS chocolate" in which this two or three gems are stored. :).
- As Name suggest JRE provide something (Environment) which help your java source-code to only run (Not develop) on your machine.
3. JVM (Java Virtual Machine).
- The engine that executes Java bytecode, providing a runtime environment for Java applications.
- It's, responsible for compiling and executing Java code.
- JVM facilitates a platform-independent way of executing Java source code. Its basis on WORA (Write Once Run Anywhere).
- JVM comes with JIT(Just-in-Time) compiler that converts Java source code into machine code.
- First, the Java compiler compiles a Java file into a Java .class file. Then, the .class file works as an input into the JVM, which loads and executes the class file.
So this is about the basic of JDK it's just over-view we will look in deep, in next blog and also guide you how it's work I mean after installation what is the responsibility of JDK and it's sub-components in our use-case.
Comments
Post a Comment