Download and Install JDK on your Computer
In this blog I will guide you to setup java on your computer so that you can run your first java program using Notepad.
What is JDK and Why it is required?#
For Developing Java Program we require JDK (Java Development Kit), It will have compiler and the Runtime environment which will help us to write a java program and execute them.
Once you install JDK along with that you will get two more things that is JRE (Java Runtime Environment) and JVM (Java Virtual Machine).

Let’s understand each of this one by one
- JDK - JDK is Java Development Kit it will have all the development tools required for compiling, debugging the java program, and various other tools are available.
- JRE - Once the program is compiled you have to execute it, for that we require JRE. JRE contains the library of the Java Classes and JVM
- JVM - JVM comes with JRE and it is the one which actually executes our program.
How all this work together?#
Let’s say we have a Java file with name First.java, when we compile this file with javac First.java
we will get First.class a compiled file.
Now to execute First.class file we have to simply run java First
command, it will start executing the file.
So, for compilation we use javac and for execution we use java.
Download and Install JDK#
After understanding JDK, JRE and JVM it’s time to download and install JDK on your computer and compile and execute your first java program.
- Visit :- https://www.oracle.com/java/technologies/downloads and install the latest version of jdk, I will install JDK 24 x64 MSI Installer you can choose other options also.

- Once downloaded simply click on installer file (.exe or .msi or .dmg) and install the setup
- After installation completes open terminal and verify the java version by running java —version command, you will see the java version which you have installed.
Compile and Execute your first java program#
Now you have successfully setup a Java Environment on your machine. It’s time to write your first hello world program and run it.
- Create a new file and paste the following code in the file and save the file with name First and extension .java (First.java).
- After that open command prompt and go to the the location where you have saved the file.
- Run this command
javac [First.java](<http://First.java>)
to compile the file, this will create First.class (Compiled file). - Now we have to simply execute this compiled file and to execute run this command
java First
Output:
Conclusion#
Congratulations! With this you have succesfully setup java on your machine and compiled, executed your first java program. Now you are ready to learn and explore the fundamental concepts of java.