0:02 what's up everyone welcome back to this
0:04 YouTube channel in this video I'll show
0:06 you how you can download and install
0:10 Java on your Macbook so let's do that go
0:11 to your favorite search engine mine is
0:15 Google and search for Java jdk download
0:19 Oracle and the first result that you see
0:22 here which is from the oracle.com click
0:23 on it
0:26 and in here we will install the Java 19
0:29 and as you can see the stabbed view here
0:32 we have uh various operating systems
0:34 listed out here Linux Mac OS Windows
0:36 since we are going to download it on Mac
0:39 OS I'm going to click on Mac OS and as
0:41 you can see we have four options here
0:44 but we are going to focus on these two
0:48 DMG installer options uh the first one
0:51 is arm 64 DMG installer so if you are on
0:55 MacBook M1 Pro or the arm
0:59 chipsets then go with the arm 64 DMG
1:01 installer if you're on Intel processor
1:05 then select the x64 DMG installer I'm on
1:08 MacBook M1 Pro so I'm going to select
1:11 this arm 64 DMG installer so I'll select
1:13 this link here click on it and as you
1:20 now as you can see the download is
1:22 finished what I will do is I'll click on
1:24 it and I'll be taken to this window uh
1:27 here I'll double click on this package
1:30 and an installer window will pop up so
1:33 let's click on continue click on install
1:36 and enter the password after that click
1:38 on install software and the installation
1:41 process will begin
1:44 and installation is successful let's
1:47 close it now you can keep the original
1:49 jdk installer file or you can move to
1:53 bin so I'm going to move it to bin
1:57 now we have done the half part of our
1:59 installation we also need to set the
2:01 Java underscore home environment variable
2:02 variable
2:05 but let's first open the terminal and
2:09 I'll type in Java dash dash version and
2:12 as you can see it says Java
2:17 19.0.2 is installed on my system so yeah
2:18 this is exactly the version that we just
2:22 installed so yeah Java is successfully
2:24 installed now we need to set the Java
2:27 underscore home variable and the way we
2:30 do that is we need to create a file so
2:35 I'm going to say touch tilde slash dot
2:39 zsh EnV and hit enter now I'll say open
2:45 tilde slash dot sir sh EnV this will
2:47 open up the file and in here you need to
2:51 type in this line export Java underscore
2:54 home is equal to dollar sign parenthesis
2:59 slash USR slash lib exec slash Java
3:01 underscore home in lowercase and then
3:04 closing parenthesis so after you have
3:07 done that save the file make sure this
3:10 is the E of the export is a lowercase
3:13 not the upper case once you save the
3:15 file we need to Source it so we can say
3:20 Source tilde slash dot service edge EnV
3:23 hit enter and now if I say Echo dollar
3:27 sign Java underscore home hit enter and
3:30 I get this value back which is the path
3:35 to our jdk 19. so yeah this is how we
3:38 set the Java underscore home variable in
3:41 mac and this completes our Java
3:44 installation now if you have any Java
3:46 file you can easily run that so yeah
3:49 actually let's try to run a Java file so
3:59 so I quickly created this simple Java
4:03 file which prints out hello world and if
4:06 I save it now
4:09 and I say Java C hello
4:11 hello
4:13 dot Java
4:16 and I say Java hello
4:18 hello
4:21 and you can see the Java file ran
4:23 successfully I got the expected output
4:25 back so yeah this is how you can
4:27 download and install Java on your
4:29 Macbook so I hope you find this video
4:31 helpful give this video a thumbs up
4:33 subscribe to my channel it keeps me
4:35 motivated for creating more videos like
4:37 this I'll see you in the next one until