How to Install Java JDK 21 on Windows 11

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello guys, welcome to Amit Thinks. In this video  we will learn how we can install the current   Java version that is Java JDK 21 on Windows  11. Let's see at first go to the web browser.   I am using Chrome you can use  any web browser here in type Oracle Java and press enter on pressing enter  the official website is visible click on it now here it is the official  website click download Java now herein you can see the download section  Java 21 is visible I told you Java 21 is JDK21 so here it is JDK 21 A1 for Windows so I'll  click here and click on the installer that is   exe file 160 MB click on it to download started  let's wait for a few seconds it's only 164 MB the download completed here is the EXE file right  click and open to begin the installation minimize the installation started click next here  is the path where in Java JDK will get   installed we will check this later click on  next keep it as it is installation started installation completed click close now let us go to the path if you remember it was  in C drive program files now here it is Java click   on it JDK 21 bin open it and right click and copy  this path we will set the environment variable go to start type environment variables click on  edit the system environment variables click open   here in under system properties Advanced  environment variables click on it now here in   go to system variables go below path double click  go to new click on it now right click and paste   the same path okay Java JDK to JDK 21 Min that  is Java 21 click OK click ok ok in the last okay   now we successfully installed it go to start  type CMD click on open to open the command prompt now to verify the installation type  Java -- version and press enter and you can see we successfully installed Java 21   okay now click close let us  run our first Java program now now since we have set the mapping  variables also we can create a   first Java program in any drive I'll  go I'll go for D: Drive right click a folder let's say I'll go for AmitProject   I'll open it now right click and  create your new text document first I'll name it let's say  studyopedia my Java file name    dot I'll just remove this and type Java I'll  just keep the cursor here and press enter   do you want to change the extension  yes from .txt to .java click   click yes now we have our Java file if you are  unable to get the extension here it's very easy go to view here in go to show and  click on file name extensions    already enabled it so everything is  visible here after that right-click   you can open it with notepad++ or  notepad okay many people prefer Notepad   because they are beginners so I'll click on  it now let us type our first program remember   your class name should be similar to your  file name so I'll type studyopedia   else there will be an error in Java now within now  within that we will type public static void main()   I'll explain this okay now this is where we will type something to print here in we type system.out.println() system is  basically, a predefined class to provide access   out is the output stream and this is println  function is to print testing so whatever   I'll print inside this will work will get  displayed Amit Thinks let's say semicolon   File and Save All now what is public static  void main() you need to always add this   public is the access specifier static is basically  it allows the main function to be called without   the need to instantiate a particular instance  okay so this will allow the main function to   be called now why it is a return type okay main is  the function wherein actually the Java application   begins this is for command line arguments  that's it go to file and save it that's it   now herein we need to reach this path on command  line type CMD on Windows 11 and press enter   so you have reached here directly now we need to  run this program so I'll just directly run it Java   javac because we first compile the Java  program then we run it so this is compiling   so first we are compiling our Studyopedia.java  file when I'll press enter if there is no error   a class file will generate here check it press  enter so there's no error and a class file   generated okay that means we successfully run it  java studyopedia to run it that's it press enter   and you can see whatever we tried printing  that is Amit Thinks text is visible here okay here it is okay so this  is how you can run our first   Java program after installing it  thank you for watching the video
Info
Channel: Amit Thinks
Views: 229,832
Rating: undefined out of 5
Keywords: Install Java JDK 21, JAVA JDK 21, Install Java 21, Install Java, Java, Set Java Environment Variable, Learn Java, How to install Java, Install Java on Windows 11, Install Java 21 on Windows 11, Windows 11, Java JDK 21, Amit Thinks, Studyopedia
Id: -hxCPXjYWJU
Channel Id: undefined
Length: 6min 33sec (393 seconds)
Published: Sat Sep 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.