Need up to 30 seconds to load.
hello guys welcome to Amit things in
this video we will see how we can easily
install the current Java version that is
Java 19. with that we will also run a
sample Java program let's see at first
go to the web browser
I am using Chrome you can use any
browser on Google type Oracle Java
press enter
on pressing enter the official website
is usable oracle.com Java
click on it
on clicking we have reached the official
website now on the top right you can see
download Java
click on it to download
go below
When You Reach below you can see Java 19
is available now
okay I'll go below again and here it is
Java 19 jdk
and go to Windows because you want for
Windows 10 and here in we will go for
the x64 installer that is the exe file
click on it to download
this also includes the JRE so we don't
need to install GRE separately
you just need to install jdk 19 for Java
click on it to download download started
it's only 159 MB let's wait for few
seconds
so guys we have successfully downloaded
it double click on to install
minimize this
so guys the installation setup is
visible click on next
here in Java path is visible
Java will get installed here jdk19 if
you want to change the location you can
click on change but this is fine click
on next
so guys we have successfully installed
jdk 19 click on close now let us see
wherein we installed it
it was under C drive if you remember
program files
Java and here it is jdk 19 path
copy this path
okay minimize
go to start
type environment variables
click on the following first one that is
edit the system environment variables
click on it open
now under Advanced tab click on
environment variables
herein you can see system variables
click on new
here in type Java underscore home
and paste the same path
which path
which we just saw okay that's it click
on OK
now go below
double click on path here
click on new
and here you need to set the path which
path
here in
click bin and set the bin path now
right click and copy it
minimize and
click new just paste the same path
okay now we have two paths we have set
two paths okay
now the third path
for that go to here
go to C drive
program files common files
here it is common files
Oracle
Java
and Java path
right click and copy this
minimize
click on new
right click the same path
click on OK OK and the last okay
now when you go to start
and type environment variables again
here it is system event variables click
on open now you can see all these paths
are visible
you can see Java underscore home path
the first path we set and under path
when you will double click you can see
two parts are visible the bin path and
the Oracle Java path that's it
we successfully added the path now go to
start type CMD click on open to open the
command prompt
so we have successfully installed now we
will verify type Java space hyphen
iPhone version and press enter
here it is we successfully installed
java19
check for compiler also Java c space
hyphen iPhone version and press enter
here it is Java 19 so we successfully
installed it now guys what we will do we
will run a first program Java program
after installing it for that
for that let's say I'll go to
D drive and herein I'll create right
click new
create
a new text document
I'll name it
I'll name it studiopedia and I'll just
change the path from txt to Java
from txt to Java okay and I'll just keep
the cursor here
and it will ask you do you want to
change the file name extension I'll
click on yes now our txt file is a Java
file here you can see Java source file
if you are unable to find this option
you are unable to rename it just go to
view and select this file name
extensions
When selecting it you will be you will
be seeing the file name extension and
you can easily rename it like this now
Guys open this with the notepad or
notepad plus plus
like this or you can edit with notepad
plus plus now let us type the code
sample code
public is an access modifier class is
the keyword and the name remember the
name of the class should be equal into
the name of the file that is studiopedia
okay now that's it just mention public
static wordman
now let us print something
system.out.println
first Java program
okay
now let us understand this public is an
access modifier
static allows Main
the main function to be called without
the need to instantiate a particular
instance okay without creating any
object we can call it using static
void is a return type
Main
this function is called whenever a Java
application begins okay string argument
I told you this is basically a parameter
Arc which is an area of instances of the
class of the class string this will
allow you to receive any command and
argument system is a predefined class
out is an output stream and println is a
method to display the string okay that's
it go to file click on Save we have
created it
it's under D drive go to the command
prompt
since we are in C drive I'll just type D
colon
and we'll reach the D drive here in
directly our file is visible so type
Java C that is first we will compile and
then we will run in Java mention the
name of the file studiopedia.java
Java and press enter
let's see if there is an error yes we
forgot the semicolon no problem
type semicolon
and click on Save
minimize
type the command again press enter
there should be no error here it is now
type Java Studio PDF
and press enter before pressing enter
you can see now we have our
studiopedia.class file so class file
generated the entire jvm process
is here so the class file is now
generated we successfully compiled it
now we will run it and after running
here it is first Java program we
successfully printed it here it is first
Java program we successfully printed it
so guys in this video we saw how we can
successfully download and install the
current Java version Java 19 we also saw
how we can run our first program thank
you for watching the video