Today, we are going to learn how to install java in your windows pc.
Java is a pretty much interesting language as it offers powerful workspace & great features which makes it even more popular among most of the languages present to date.
If you are new to programming, you must be thinking that if it really a great language to start with?
Well, Java is itself a great language to learn. A new programmer who is willing to learn can easily learn this amazing language within a couple of months.
So let’s start with:
Knowing the architecture of your PC.
To install java in your windows pc, you first need to know the structure of your windows pc.
To do so you need to follow the below-given steps:
- Go to Start, then search for the Control Panel.
- When you are inside of the control panel, navigate your self to System and Security and then to System.
- There you will get your System Type which will help you decide which version of Java you should download to install in your pc. Check these images below for reference.
- In the above-given image, my pc is running over a 64-bit architecture so I need to download a 64-bit jdk.
Installing Java to Windows PC.
Now, when you have found what type of system you are using, we are a step ahead in our way to install java in windows pc.
- Now, simply click on the installer which will soon ask you that “This program wants to make changes…”. Just click Yes & move on.
- You will see an Installation Wizard popping right onto your screen. Just click Next.
- As soon as you click Next another screen saying Custom Setup will be shown.
- Click on Change. Now you can choose whichever directory you want but remember, the deeper the directory goes, the more you have to dig to reach it while you are in cmd i.e while running a program.
- A better way is to install it directly in a folder (named Java in the above image) in C: Drive renaming jdk 1.8…. to jdk which will save you from typing the whole version of your jdk every time you try to run a program.
- After that, click Ok & then Next.
- Just after that, another screen will appear will start installing this Environment into your system.
Run your first Program.
Now, when you have successfully installed Java in your pc, you might be thinking about how to run your first program?
Don’t worry, we will learn in below-given points.
Bonus Point: You can use a source code editor to make your programming look a bit more professional and interesting. I recommend you use notepad++ which is a free source code editor which comes with tonnes of features. You can download it from here.
- First of all, you need to write a source code for your program. For that, I will leave a text file. You can download it by visiting here.
- Now, put this file in (C:>Java>jdk>bin) folder or the path where you installed java.
- Now, open cmd and type
cd/javac/jdk/bin/which will put you to the directory where you have put the .java file.
- Then, type javac Hello_world.java, here, javac is a keyword to compile this program & Hello_world.java is the filename of your source code file.
- After the program has successfully compiled java keyword will execute your program.
- An output saying Hello world will be on your screen.
Now when you have figured out how to install java in your windows pc, run some java built program and show them up in the comments section.
If you have any query related to this post, feel free to share them below in the comment section.
Thank you for being here.