In this first lesson, we are going to set up the Java programming environment for running our first program. To run Java programs in your PC, you need to install the Java Development Kit (JDK) and a text editor. Any simple text editor will do. Here, we will be using the Atom text editor - which is specially designed for programmers.
You can find the JDK from the Oracle site (or via Google search). Note that you must install the JDK, not JRE. The installation site will probably have both of them listed. Download the appropriate version of JDK for your system. If you are using a 32 bit machine download the x86 version, if your machine is 64 bit download the x64 version,
(The instructions in this post are going to be for a Windows PC. If you are using Linux or MAC, you will just need to do a little web search on setting up the JDK and Atom in your particular OS. It is not that hard.)
After downloading install the JDK. Next, download and install the Atom text editor from https://atom.io
To compile and run Java programs, we need to configure one more thing. Go to the Control Panel and search for environmental variables. Open Edit the system environmental variables and you will see this:
Now click on the Environment Variables button as shown above. There you will find a list of System variables. Select the variable name Path and click Edit...
In the box Variable value, type the location of your JDK bin folder (separated by a ";"). An example is shown in the image below: (note that your JDK version may be different)
Save the changes. Now, open Atom. Go to File > New File. You will see a space to write your code.
Our set up is done. You are ready to write your first Java program.
