All right, everyone, welcome back to the U.S..
In this section, we will see how you can run Java programs
inside your Visual Studio or write student Java programs.
You need to have Java installed in your device.
So to check the installation of Java, you can open up your terminal and here
type in Java space hyphen hyphen version.
And if this prompts out to be a message something like this
in Java is not installed in your device.
Right. So let's install Java first. Okay.
So let's head over to our browser and open this link.
I will attach this link to the resources so you can just directly
go to this web page.
Now, here you can download
the Java development kit for your particular operating system.
In this case, I'm going to install or download
the installer version for Windows, right?
So just click on this link to download
and I have already downloaded it, so I'm not going to download it again.
And let me just remove this and now let me just install it in front of you.
Now, while installing it, make sure you remember the part
where Java is installed in your device and then just simply click on next
and let the installation progress be completed.
Now, once this is done, you can close the installer
and you can head over to your program files.
And in the Java folder, just go to the envelope
and just copy the link of this bean folder.
And we need to make sure that this bin folder is added to our environment
variables so that our system can detect the Java installation.
Right?
So just search for environment variables, go to the environment variables,
click on the port section and here we need to edit
it and make sure we just click on the new option
and add this location to your environment variables.
Click okay and then it's okay to save this.
Now let me just close it and let's head over to our voice
code again and inside here and let's type in the same code.
And if I hit and do now, make sure you restart
your Visual Studio code after you have installed the Java.
Right.
So let me just close it and let me open it again with the same folder.
Now let's type in Java
space, hyphen hyphen version and let's hit enter.
And now you can see Java is installed in our device.
Let's see DirectX version.
So this is the latest version
of Java Sea installed in our device.
Now let's write a simple Java program and let's see how it runs.
Now, before writing and executing the Java program,
you need to have a Java extension of the core installed.
So let's simply search for Java extension here
and you can see the extension back for Java.
This extension comes with IntelliSense code right now.
Debugger and lots of more support for Java.
So simply install it and reload
your voice code once this is installed.
Now, once this is done, let's write a simple hello while Java program.
So let me just create a hello dart java file
and inside here let me write the Java program.
Now, to run this
program, we have already installed
a Java program runner with that extension back for Java.
But if you have the code, run that extension of obvious code installed.
In my case code run that is installed in this voice call, you can see.
So if you are using code or another, then you might face some issues
while running the Java program.
So just simply expand or click on this
o arrow down option inside this play button.
And here select this option of run Java.
This will run your Java program properly and you can see
the halo will output, right?
So in this case, Java program is running inside the terminal of my voice code.
And if yours is running inside the output window, then you can go
to the preferences of the code and here you can search for run in terminal
and inside the extensions.
You will find this option and make sure you selected
you have selected this running terminal option
to run the Java programs and dominant and take the user input manually.
Right.
So this is the first lecture
on how to use Java programs inside your Visual Studio code.
In the upcoming lectures, we will see how you can
manage our project inside your Visual Studio code.
So see you in the next lectures.