Java Environment Setup Windows 10 / 8 / 7

Hello friends, this is my very first post, and in this blog I will be start posting about Java. So the first post is about Java Environment Setup Windows. If you don’t know how to make your system ready for Java development then you can go through this guide. So lets learn about Java Environment Setup in Windows.

Java Development Kit (JDK) Download

So the first thing we need is JDK. It is quite easy to get JDK you can download it from oracles website. Follow these steps to get JDK.

  • Go to this link.
  • You will see the following screen.

java environment setup windows

  • Click on Accept License Agreement.
  • Then click on the required version. In my case I will download Windows x64 because I have 64bit Windows Operating System. You need to choose your version according to your system.
  • Then you will get the JDK Setup file, install it in your system, the process is same as installing any other application program in windows operating system.

Java Environment Setup Windows

Once you have got the JDK installed in your system, you need to set up the environment variables to make it work. So I will teach you this now.
Follow these steps carefully to get your system ready to compile your very first Java program.

  • Go to Java installation directory. (c:/program files/Java/jdk<your version>/bin);
  • You need to copy the exact path according to your system. In my case the path is.
  • Once you have copied this file, press windows + q (for windows 8) and for windows 7 click on start menu.
  • Type environment variables

environment variables

  • Now click on System Environment Variables.

environment variables windows

  • Now in the bottom you can see the button Environment Variables click on it.

System Variables

  • In the System variables section click on new.

Path

  • In variable name type path and in variable value paste the path you have copied as shown in the above image.
  • Finally press ok to apply the changes and you are done.

Testing the Java Installation

  • Now lets test whether the installation is successful or not.
  • For this just open command prompt (window key + r, then type cmd and hit enter).
  • Now write the following command.
  • If you are getting the following result then, your installation is successful and you can move further to compiling Java program.

java installation

Writing your first Java Program

Now lets try executing our very first Java program. You need a text editor to write your codes. I am using Notepad++ you can also use the normal notepad but I will recommend you using Notepad++. You can get Notepad++ from this link.

  • Open notepad++ and write the following code.
  • Now save the file in any location of your system. I have saved it to my desktop. The name of the file should be HelloWorld.Java (public class name and file name should be same).

Compiling and Running your first Java Program

  • Press shift and right click on the location where you saved the file.

java environment setup windows

  • Click on Open command window here. Command prompt will open on the same directory.
  • On command prompt write Javac yourfilename.Java see the screenshot for help.

compiling with javac

  • Now if you haven’t got any error executing this command, that means the code is correct and compilation is successful.
  • The successful compilation will generate the .class file which contains the bytecode that will be executed by the Java Virtual Machine.
  • To execute the program just type Java classname (see the screenshot).

running java program

  • So its working absolutely fine, you can see we got our output.

Conclusion

So I am wrapping up this post about Java environment setup windows here. Java is the most popular programming language used nowdays. Java is used everywhere like we all use android mobile phones and to develop android applications Java is used. Java is used in web development, Java is used in desktop software development and almost everywhere you can use Java. So in the upcoming posts we will be doing some cool interesting stuffs with Java.
And leave your comments for feedback and clearing your confusions related to this Java environment setup windows tutorial. Thank You 🙂

13 thoughts on “Java Environment Setup Windows 10 / 8 / 7”

  1. Nice blog here! Also your site loads up fast! What web host are you using?
    Can I get your affiliate link to your host? I wish my web site loaded up as fast as
    yours lol

    Reply
  2. Hi there, I found your site by the use of Google while searching for a similar topic, your web site came up, it appears to be like great. I have added to faotruives|added to bookmarks.

    Reply
  3. Nice post. I was checking constantly this blog and I’m impressed!
    Very useful information particularly the last
    part ? I care for such information a lot. I was seeking this certain information for a very long time.

    Thank you and best of luck.

    Reply
  4. Excellent pieces. Keep posting such kind of information on your
    site. Im really impressed by your site.
    Hello there, You’ve done a fantastic job. I’ll certainly digg it and
    personally recommend to my friends. I am confident
    they’ll be benefited from this site.

    Reply

Leave a Comment