Hi everyone.
Welcome back.
In this lecture we are going to be installing the latest version of Java in our machine.
At the time of recording the lecture.
The latest long term stable version is Java 25.
So here is a GitHub repo.
There are the steps to install Java 25 in your machine.
I'll be attaching this link also as a resource in the lecture.
So if you go a little bit down here we have two options.
One is installing the Java using the installer.
The next one is installing the Java using the SDK man.
So here I have the link to the latest LTS version number one is the Java 25 over here.
And number two is Java 21.
And Java 25 is the latest version at the time of recording this lecture.
So you are welcome to follow the steps over here.
So in this case if we go here here we have the Linux version.
And then we have the Mac OS version and the windows version.
All you got to do is download the installable and then you basically go ahead and install it.
But the option that I am going to be doing here is the Java installation using the SDK man.
So the benefit of using Java SDK man is that it is very easy to manage multiple versions of Java in
your machine.
So let's go to this link and then see how it works.
The very first thing is we need to install this SDK man.
So if you go to the home page here this is basically the software development kit manager.
That's what SDK man means.
So here it says that your reliable companion for effortlessly managing multiple software development
kits on Unix systems.
Because when you work on different projects, you may need to switch between different versions because
one of the project might be using the latest version, and some of the projects might still be in the
migration mode, which means it might be in the older version.
So that's when this SDK man comes in really handy.
So now let's go back to the installation steps.
So in here the very first thing is installing the SDK man okay.
And the first thing is we need to run this particular command.
If you're using windows we have two options here.
Number one is that you can install the Windows Subsystem for Linux before attempting the SDK installation.
Or if you have a git bash, you can basically use git bash to run these commands that I'm going to explain
after you have these two solutions or one of the solution available.
So it says that remember SDK man requires a bash environment to run on windows.
It can't be natively installed.
You need WSL or Msys plus min GW.
We no longer support Cygwin.
That's what they say okay let's go to the top.
So and then I'm going to copy this command, go back here and then run this command.
So you can see that it gave me this message immediately.
This means I already have the SDK installed.
So that's why I got this message already readily available.
If you have not done this before, then it might take a little while to download the dependencies for
you.
Once that step is done, the next step is to run this one.
Basically, this is going to source the SDK man initialized in your terminal.
And then the next step is let's run this one SDK version.
I run this one.
So the version that I'm using at this point is this version.
When you install, you might have a latest version being installed, but you need to see a message like
this.
Okay.
So now let's go back to the browser and then let's go back to the Java installation tab.
So first thing is we are going to be running the SDK list Java Java.
It's going to list a bunch of versions over here.
So these are the different vendors that provide different versions of Java available for us to choose
and install.
And if you go a little bit down, the one that I'm going to be using is the version which is an open
source version.
There you go.
So in my machine I already have the Java 25 installed, but I will still show you the steps for how
to install this one.
And I also have the Java 21 and I also have the Java 17.
I'll show you how we can switch between these versions very easily using the SDK man.
Okay, so I have exited that list.
The next step is go back to the page and then I'm going to be running this command.
What I'm doing over here is that we did the SDK list Java.
Right.
And I'm going to be grep the string 25.
When I do that it's going to give me from the result.
What are all the different 25 versions available.
So if we do this.
So these are the different versions of Java 25 readily available.
And these are the vendors we have Corretto, Graalvm Microsoft Oracle everyone have different versions.
I'm going to be using the tamarin version.
If you're wondering about what is a tamarin version let's go ahead and search for it.
Tamarin JDK.
So this is from the RTM one okay.
And then if you click here what we do over there Adoptiom champions open source Java solutions empowering
business with a cutting edge technology and collaborative innovation.
So this is basically a project from adopt.
OpenJDK was established in 2017, following years of discussions about the general lack of an open and
reproducible build and test system for OpenJDK.
So this is coming from the open JDK.
That's why I prefer this particular vendor.
Let's go back here and then I'm going to be running another command.
Let's go back to the installation steps here.
And then I'm going to be running SDK install Java 25.
Let's run this over here.
There you go.
I already have 25 installed.
That's why I get this message.
If you're running it for the very first time, it will take a little while for the installation to complete.
Okay, so now what I'm going to do is I'm going to be running Java version.
So if we do it.
So this is the version I have in my machine which is Java 25.
Now if I go back to steps over here now let's say I want to switch to a different version.
Okay.
So now I want to switch to 21.
How do I do it.
So in this case I'm going to be copying this if I do a install.
So it's just giving me this message.
So in my machine for some reason the older ones that I have installed using SDK man it is actually having
this particular text which is local.
So these are the different versions I have.
Right.
So now let's say if I want to switch to Java 21.
So what I need to use is that SDK.
Use this one.
So if I give this now this is going to be I believe the command is SDK.
Use Java and then provide this one.
There we go.
Now we have use Java version in the shell.
So now if we so if we do Java version it's going to give you the version as this one.
Now let's say I want to switch back to Java 25.
What do we do.
So I'm going to do the same thing over here SDK this one.
And then it's going to be 25.
So now we have switched to Java 25 version.
So in this case Java version we do this.
This is going to give you the version as Java 25.
This means that this particular shell is going to be using Java 25.
So this is how much easy to switch between different versions when you're using SDK man.
So this is my recommended way of managing Java versions in your local machine.
So we have successfully installed the latest long term stable version which is Java 25.
This marks the end of this lecture.
Thank you for watching.