WEBVTT

00:00.120 --> 00:00.720
Hi everyone.

00:00.720 --> 00:01.360
Welcome back.

00:01.360 --> 00:06.200
In this lecture we are going to be installing the latest version of Java in our machine.

00:06.200 --> 00:07.800
At the time of recording the lecture.

00:07.800 --> 00:11.880
The latest long term stable version is Java 25.

00:12.080 --> 00:13.240
So here is a GitHub repo.

00:13.280 --> 00:16.920
There are the steps to install Java 25 in your machine.

00:16.920 --> 00:20.120
I'll be attaching this link also as a resource in the lecture.

00:20.120 --> 00:22.800
So if you go a little bit down here we have two options.

00:22.800 --> 00:25.880
One is installing the Java using the installer.

00:25.920 --> 00:30.040
The next one is installing the Java using the SDK man.

00:30.200 --> 00:37.080
So here I have the link to the latest LTS version number one is the Java 25 over here.

00:37.080 --> 00:39.040
And number two is Java 21.

00:39.040 --> 00:43.000
And Java 25 is the latest version at the time of recording this lecture.

00:43.000 --> 00:45.600
So you are welcome to follow the steps over here.

00:45.600 --> 00:49.160
So in this case if we go here here we have the Linux version.

00:49.160 --> 00:51.600
And then we have the Mac OS version and the windows version.

00:51.600 --> 00:56.720
All you got to do is download the installable and then you basically go ahead and install it.

00:56.720 --> 01:02.380
But the option that I am going to be doing here is the Java installation using the SDK man.

01:02.420 --> 01:08.620
So the benefit of using Java SDK man is that it is very easy to manage multiple versions of Java in

01:08.620 --> 01:09.420
your machine.

01:09.460 --> 01:12.100
So let's go to this link and then see how it works.

01:12.100 --> 01:15.340
The very first thing is we need to install this SDK man.

01:15.380 --> 01:21.300
So if you go to the home page here this is basically the software development kit manager.

01:21.300 --> 01:23.540
That's what SDK man means.

01:24.060 --> 01:29.420
So here it says that your reliable companion for effortlessly managing multiple software development

01:29.420 --> 01:30.860
kits on Unix systems.

01:30.860 --> 01:35.500
Because when you work on different projects, you may need to switch between different versions because

01:35.500 --> 01:40.460
one of the project might be using the latest version, and some of the projects might still be in the

01:40.460 --> 01:43.660
migration mode, which means it might be in the older version.

01:43.660 --> 01:46.740
So that's when this SDK man comes in really handy.

01:46.940 --> 01:49.260
So now let's go back to the installation steps.

01:49.420 --> 01:53.420
So in here the very first thing is installing the SDK man okay.

01:53.460 --> 01:56.380
And the first thing is we need to run this particular command.

01:56.380 --> 01:59.270
If you're using windows we have two options here.

01:59.270 --> 02:05.950
Number one is that you can install the Windows Subsystem for Linux before attempting the SDK installation.

02:05.950 --> 02:12.070
Or if you have a git bash, you can basically use git bash to run these commands that I'm going to explain

02:12.070 --> 02:15.870
after you have these two solutions or one of the solution available.

02:15.870 --> 02:20.310
So it says that remember SDK man requires a bash environment to run on windows.

02:20.310 --> 02:22.030
It can't be natively installed.

02:22.270 --> 02:26.710
You need WSL or Msys plus min GW.

02:26.910 --> 02:28.630
We no longer support Cygwin.

02:28.630 --> 02:30.750
That's what they say okay let's go to the top.

02:30.870 --> 02:34.550
So and then I'm going to copy this command, go back here and then run this command.

02:34.550 --> 02:37.270
So you can see that it gave me this message immediately.

02:37.270 --> 02:40.790
This means I already have the SDK installed.

02:40.790 --> 02:43.950
So that's why I got this message already readily available.

02:43.950 --> 02:48.990
If you have not done this before, then it might take a little while to download the dependencies for

02:48.990 --> 02:49.230
you.

02:49.270 --> 02:52.350
Once that step is done, the next step is to run this one.

02:52.350 --> 02:57.070
Basically, this is going to source the SDK man initialized in your terminal.

02:57.070 --> 03:00.330
And then the next step is let's run this one SDK version.

03:00.370 --> 03:01.050
I run this one.

03:01.050 --> 03:04.330
So the version that I'm using at this point is this version.

03:04.330 --> 03:09.370
When you install, you might have a latest version being installed, but you need to see a message like

03:09.370 --> 03:09.690
this.

03:09.730 --> 03:10.250
Okay.

03:10.290 --> 03:15.250
So now let's go back to the browser and then let's go back to the Java installation tab.

03:15.250 --> 03:19.730
So first thing is we are going to be running the SDK list Java Java.

03:19.890 --> 03:22.290
It's going to list a bunch of versions over here.

03:22.290 --> 03:27.810
So these are the different vendors that provide different versions of Java available for us to choose

03:27.810 --> 03:28.250
and install.

03:28.250 --> 03:33.010
And if you go a little bit down, the one that I'm going to be using is the version which is an open

03:33.010 --> 03:33.650
source version.

03:33.650 --> 03:34.090
There you go.

03:34.130 --> 03:39.450
So in my machine I already have the Java 25 installed, but I will still show you the steps for how

03:39.450 --> 03:40.530
to install this one.

03:40.530 --> 03:44.890
And I also have the Java 21 and I also have the Java 17.

03:45.210 --> 03:50.570
I'll show you how we can switch between these versions very easily using the SDK man.

03:50.610 --> 03:53.090
Okay, so I have exited that list.

03:53.090 --> 03:57.460
The next step is go back to the page and then I'm going to be running this command.

03:57.460 --> 04:00.820
What I'm doing over here is that we did the SDK list Java.

04:00.820 --> 04:01.060
Right.

04:01.060 --> 04:03.860
And I'm going to be grep the string 25.

04:03.900 --> 04:06.820
When I do that it's going to give me from the result.

04:06.820 --> 04:09.460
What are all the different 25 versions available.

04:09.500 --> 04:10.380
So if we do this.

04:10.380 --> 04:14.100
So these are the different versions of Java 25 readily available.

04:14.100 --> 04:20.100
And these are the vendors we have Corretto, Graalvm Microsoft Oracle everyone have different versions.

04:20.100 --> 04:21.860
I'm going to be using the tamarin version.

04:21.900 --> 04:25.380
If you're wondering about what is a tamarin version let's go ahead and search for it.

04:27.660 --> 04:28.700
Tamarin JDK.

04:28.700 --> 04:30.700
So this is from the RTM one okay.

04:30.740 --> 04:36.860
And then if you click here what we do over there Adoptiom champions open source Java solutions empowering

04:36.860 --> 04:40.500
business with a cutting edge technology and collaborative innovation.

04:40.500 --> 04:43.020
So this is basically a project from adopt.

04:43.020 --> 04:49.460
OpenJDK was established in 2017, following years of discussions about the general lack of an open and

04:49.460 --> 04:52.980
reproducible build and test system for OpenJDK.

04:53.020 --> 04:54.780
So this is coming from the open JDK.

04:54.900 --> 04:57.120
That's why I prefer this particular vendor.

04:57.160 --> 05:00.400
Let's go back here and then I'm going to be running another command.

05:00.440 --> 05:03.080
Let's go back to the installation steps here.

05:03.080 --> 05:06.760
And then I'm going to be running SDK install Java 25.

05:07.080 --> 05:08.280
Let's run this over here.

05:08.320 --> 05:08.800
There you go.

05:08.840 --> 05:11.840
I already have 25 installed.

05:11.840 --> 05:13.320
That's why I get this message.

05:13.320 --> 05:17.800
If you're running it for the very first time, it will take a little while for the installation to complete.

05:17.840 --> 05:22.200
Okay, so now what I'm going to do is I'm going to be running Java version.

05:22.200 --> 05:23.120
So if we do it.

05:23.120 --> 05:26.960
So this is the version I have in my machine which is Java 25.

05:27.000 --> 05:32.560
Now if I go back to steps over here now let's say I want to switch to a different version.

05:32.600 --> 05:33.080
Okay.

05:33.120 --> 05:34.680
So now I want to switch to 21.

05:34.720 --> 05:35.520
How do I do it.

05:35.520 --> 05:39.480
So in this case I'm going to be copying this if I do a install.

05:39.520 --> 05:41.320
So it's just giving me this message.

05:41.320 --> 05:48.000
So in my machine for some reason the older ones that I have installed using SDK man it is actually having

05:48.000 --> 05:50.120
this particular text which is local.

05:50.120 --> 05:51.880
So these are the different versions I have.

05:51.920 --> 05:52.400
Right.

05:52.440 --> 05:55.850
So now let's say if I want to switch to Java 21.

05:55.850 --> 05:57.930
So what I need to use is that SDK.

05:57.970 --> 05:59.010
Use this one.

05:59.010 --> 06:03.290
So if I give this now this is going to be I believe the command is SDK.

06:03.330 --> 06:06.010
Use Java and then provide this one.

06:06.050 --> 06:06.570
There we go.

06:06.570 --> 06:09.490
Now we have use Java version in the shell.

06:09.490 --> 06:14.810
So now if we so if we do Java version it's going to give you the version as this one.

06:14.810 --> 06:17.530
Now let's say I want to switch back to Java 25.

06:17.570 --> 06:18.170
What do we do.

06:18.170 --> 06:21.570
So I'm going to do the same thing over here SDK this one.

06:21.570 --> 06:23.930
And then it's going to be 25.

06:24.210 --> 06:26.890
So now we have switched to Java 25 version.

06:26.890 --> 06:30.010
So in this case Java version we do this.

06:30.010 --> 06:33.010
This is going to give you the version as Java 25.

06:33.050 --> 06:36.930
This means that this particular shell is going to be using Java 25.

06:36.930 --> 06:42.370
So this is how much easy to switch between different versions when you're using SDK man.

06:42.410 --> 06:46.690
So this is my recommended way of managing Java versions in your local machine.

06:46.690 --> 06:52.170
So we have successfully installed the latest long term stable version which is Java 25.

06:52.330 --> 06:53.650
This marks the end of this lecture.

06:53.650 --> 06:54.450
Thank you for watching.
