how to install java on windows in simple steps

Wants to start out in java and having trouble in installing java or confused in configuration settings required to install java on windows, then you are at the right place.

In this article i will explain how to install java on windows and after reading this complete guide, you will have no doubts about install java in windows.

So we will install java on windows 10 in this example but you can follow this and install java for windows regardless of any version of windows.

Download Java SE development Kit

To install java on windows we need to download it first.

So go ahead and download java.

Once you’ve downloaded it successfully, then you are good to go.

Install Java SE development Kit

Now that you’ve downloaded jdk, you have a new file inside downloads folder, open it and start installing it.

Open the execute able file and click on next.

Leave everything as default for now, we will change it later.

Once you’ve finished the setup wizard, then you need to configure environment variable path.

Configuring Environment Variables

To configure your environment variables, right click on this PC and click on properties.

how to install java on windows in simple steps

Then click on advance system settings in the lower left corner.

how to install java on windows in simple steps

You will see a screen like this and then from that screen click on environment variables from the lower right corner.

how to install java on windows in simple steps

Then head over to user variables for your computer and click on path and hit edit.

how to install java on windows in simple steps

And click on OK, your environment path will be set.

how to install java on windows in simple steps

Under system variables click on path and hit Edit and you will a screen like the above at right side. Click on new and paste C:\Program Files\Java\jdk14\bin. And click on OK. So You have successfully installed java and configured environment variables for java.

Now you are ready right some JAVA code.

Create a new file and name it as hello_world.java

Add these lines of code to it.

public class hello_world {
    public static void main( String[] args ) {
        System.out.println("Hello, my name is Mubashar!");
        System.out.println("Welcome to violentcoding.com!");
        System.out.println("This is My website.");
        //System.out.println("Your are my guest here.")
        //this is a comment
        System.exit(0); //another comment
    }
}

Once you save it as hello_world.java, then you are ready to run it.

open up CMD and navigate to the folder where you’ve saved your file. In my case it is at desktop. So i will navigate to my desktop using command prompt and type the following commands.

cd desktop
javac hello_world.java
java hello_world

You should see something like this.

how to install java on windows in simple steps

Leave a Reply

Your email address will not be published. Required fields are marked *