How to setup Java 18 on Visual Studio Code | Updated 2022

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to amit things in this video we will see how we can easily set up java 18 on vs code so it's very easy at first we will download and install java 18 after that we will download and install vs code that is visual studio code after that we will see how we can connect both vs code and java 18 so that we can run our first java program on vs code okay so let's begin with the first step that is to download and install java jdk 18 the current java version let's begin at first go to the browser i am using chrome you can use any browser on google type or record java press enter on pressing enter you can see the official website is visible oracle.com click on it to open on opening on the right itself on the official website you can see download java click on it after clicking here in you can see java 18 is available now so this is what we want for windows i'll go below here it is java 18. now linux mac and windows for all three platforms the java 18 version is visible we want for windows i'll click here on clicking now you can see that now you can see three files are visible to download we will go for the installer x64 that means for 64-bit windows 10 click on this file to download on clicking the download will start here and you can see 153 mb only let's wait for few seconds so here in guys you can see we have successfully downloaded the java 18 the jdkt exe file remember that for java we only need jdk now we don't need to install gre separately because this installation includes gre also so i'll just double click on it to install minimize this guys the installation started now let us click on next after clicking nest here in you can see it will create a java directory in program files and the installation will go inside it the installation files will go inside it you can change the location from here but the default is fine click on next the installation started now so guys we have successfully installed it click on close now let us see wherein we have installed java remember it was in c drive program files here is java inside jdk 18 i told you it will get installed here now here and go to bin right click and copy this path now minimize go to start type environment variables here and click on edit the system environment variables the first one click on open click on environment variables from here here in under system variables the path is visible we will set the path now double click on it click on new and just just right click and paste the same path so we pasted the following path now guys click on ok now here i'll also create another part that is new that is click on new this will be java underscore home path parent pays the same variable value that is the path but remove the bin here that's it click on ok we have set two paths click on ok and click on the last ok that's it so guys we successfully installed java 18 let us verify the installation go to start type cmd click on open to open the command prompt so we have started the command prompt type java space hyphen iphone version and press enter on pressing enter you can see java 18 is visible that means we have successfully installed it let us close this now guys we will move to the second step and we will download and install vs code that is video studio code let's begin at first go to the browser i am using chrome you can use any browser on browser type visual studio code press enter on pressing enter you can see the official website is visible code.visualstudio.com click on it so vs code that is visual studio code is owned by microsoft and it is freely available that is open source here you can see the current version for windows is visible you can click on the drop down so that you can check the versions for mac and linux also i want for windows so i'll directly click here download for windows now download started here it is it's only 72 mb let's wait for few seconds and you can see the setup downloaded exe file now double click on it to install minimize this click on i accept the agreement click on next here and you can see it will get installed in the following location and it will only take 287 mb if you want to change the location you can click here but i'll keep the default and click on next click on next again it will set the path also i'll click on next again click on install now the installation started the setup completed guys when i'll click on finish it will automatically launch click on finish it started guys here it is here it is guys so guys we successfully installed vs code let us now see how we can connect both java and vs code for that we need to download the coding pack for that we need to go to the web browser here in type press enter on pressing enter you can see the official website is visible code.visualstudio.com and java in vs code is visible click on it on clicking you can see the java and visual studio code section is visible we have also added this link in the description go below here in click on the windows pack that is install the coding pack for java for windows that is vs code for java click on it after clicking the download will begin here is the download it's only 56 mb let's wait for few seconds now download completed guys the exe file double click on it minimize this so guys the coding pack for java is visible click on next it accepted the terms in the license agreement on its own you can read here click on next now you can see it automatically took that we have jdk 18 because we just installed it and the current vs code version so we will click on install and to configure not installing java extensions let's wait so the setup is complete it will automatically launch vs code click on finish so guys here it is now we will run our first java program java 18 program on vs code for that let us go to explorer click on open folder go to desktop here and directly create a new folder okay it got created here as well you can see type let's see the name is zomic project double click on it and select the folder that's it after selecting it will open the folder here amit project herein you can directly click here and create a new java file that is new file or you can right click and and type new file now add the name of your java file i'll type demo.java and i'll press enter and the file got created you can see amit project and here is the demo.java file now let us quickly write our first program since our file name is demo.java the class name will be the same that is demo here it is guys we have printed it now let us understand it before running here the public is an excess specifier class is the keyword basically to define a new class so we defined the class demo so we defined the class demo you can use any name for class here it is public static void main this is main public is an excess specifier static basically allows the main function to be called without the need to instantiate a particular instance so this main calls whenever whenever any java application begins string arguments is for command line arguments that is if you want to receive input from command line arguments you can use this this is an arresting array and let us go to system.out.println which is used to print any line system is a predefined class out is an output stream and println is a method to display the string so we will display the following string now let us go to file click on save all now guys after understanding the code let us go to terminal and click on new terminal to run it in terminal here and we will add the basic command to run java that is java c the name of the file that is demo.java this will compile the code press enter compile successfully now we will run it just type java space the name of the file without the extension and press enter here you can see we successfully ran and the following is displayed first java program and vs code that is the same line so here and you can see the demo dot cloud the demo. class file also got generated so whenever we compile java programs a class file gets generated so guys in this video we saw how we can easily set up java 18 on vs code if you like the video do subscribe to our channel with things
Info
Channel: Amit Thinks
Views: 63,333
Rating: undefined out of 5
Keywords: Visual Studio Code, java 18, vs code, Java on VS Code, VSCode editor, Windows 10, amit thinks
Id: 3J1tCS_te4o
Channel Id: undefined
Length: 10min 37sec (637 seconds)
Published: Sun Mar 27 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.