How to install Java? - Programmics! - Programmics! - We Love to Code.
demo image

How to install Java? - Programmics!

Share This
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 till 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.

But before you just jump into the pool of programming, you need to install its Run-Time Environment into your PC. To do so, just follow up the given following steps:
 

Knowing the architecture of your PC.

First of all, we need to check the architecture of our pc. For that,

  1. Go to Start, then search for the Control Panel.
  2. When you are inside of the control panel, navigate your self to System and Security and then to System.
    Control Panel showing system and security
  3. There you will get your System Type which will help you decide which Java Version of Java will work for your PC. Check these images below for reference.

System

Architecture
Now, when you have found what type of system you are using, you have to download it for your PC. You could simply Google search it or simply check out the link given. Download JDK

Installing Java to your 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. 


  • 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.
  • A new screen saying Destination Folder will be the next thing to show up on your screen. Repeat the above step and put the jre folder in the same folder (Java) in C:Drive. After that, let's move forward by pressing 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, you might be thinking about how to run your first program? 
 
Don't worry, we will learn in below-given points.
  • First of all, you need to write a source code for your program. For that, I will leave a text file. You can download by clicking here.
 
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.

  • Now, rename the file extension to .java & put it 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 putted the .java file.
  • Now, open cmd, type cd/Java/jdk/bin which will bring you to the bin folder.
  • 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.

Thank you for being here.

No comments:

Post a Comment