How to Install Java JDK on Windows 11 + Set Environment Variables

How to Install Java JDK on Windows 11 + Set Environment Variables

Yo what's up guys..., hope you all are fine there

So I'm here to help myself for installing JDK (Java Development Kit), which I will use for my study and coursework

First, what do we need to do?

cz it's my first time and I don't know where to start so let's just ask google, Hey google I want to download jdk for my windows 11

image.png

Here's the link to download JDK

image.png

as you guys know I need to install JDK on my windows 11

so I'll just choose the Windows option with x64 Installer

Second, Let's run the installation setup

after completing the download, you can run the installation setup

image.png

image.png

click on next

image.png

this is where java will be installed in following directory

if you want to change directory, you can choose change... but i will keep with the default

then click on next

image.png

And we successfully install JDK 19

but it's not done yet, we still need to configure the environment variables guys

Third, We need to configure the environment variables

now, we need to see where we installed java before

image.png

after that, just type environment variables on your windows 11 and click on open

image.png

image.png

under Advanced, click on Environment Variables...

image.png

you can see path is under System variables then double click on path

image.png

click on new and we need to fill with the bin path in our java folder

let's go back to the bin directory in our java folder

image.png

click on path and right click then select copy

image.png

and we click on new and right click to paste the path

now, we need to create a new path for javapath (in my case the javapath was configured automatically so i'll skip this, but if you don't see it anywhere i'll give you the steps to create it)

we go to the javapath directory located C:\Program Files\Common Files\Oracle\Java\javapath

image.png

click on path and right click then select copy

image.png

click on new and paste the path

okay so this is the last one, we need to create JAVA_HOME System Variable

image.png

under System variables, click on new to create a new system variable

we go to where we installed java before

image.png

click on path and right click then select copy

image.png

fill in the name of the variable and its value, then click OK

oke so we have successfully installed and configured java environment variables

Fourth, Check on CMD whether our java is successfully installed and configured

let's go to cmd to see if our java was configured correctly

image.png

type java --version and you can see we successfully installed java 19

also check javac or java compiler by typing javac --version

and DONE, finally now I can run my first java program

Thanks guys for reading my java jdk installation journey, if you guys have any feedback you can comment below