Monday , March 30 2020
Home / Java / JAVA #03 – JDK, Netbeans Installation and Environment Variable Configure

JAVA #03 – JDK, Netbeans Installation and Environment Variable Configure

1.  How To Install JDK on Windows

Step 1(a): Un-Install Older Version(s) of JDK/JRE

I recommend that you install the latest JDK, but it can be messy if you have multiple versions of JDK/JRE.

If you have previously installed older version(s) of JDK/JRE, un-install ALL of them. Run “Control Panel” ⇒ Program and Features ⇒ Un-install programs begin with “Java”, such as “Java SE Development Kit” and “Java SE Runtime”. If you are not sure whether you have older version(s) of JDK, check!

Step 1: Download JDK
  1. Goto Java SE download site @ http://www.oracle.com/technetwork/java/javase/downloads/index.html.
  2. Under “Java Platform, Standard Edition” ⇒ “Java SE 8ux” ⇒ Click the “JDK Download” button.
  3. Check “Accept License Agreement”.
  4. Choose your operating platform, e.g., Windows x86 for 32-bit Windows OS or Windows x64 for 64-bit Windows OS. You can check whether your Windows OS is 32-bit or 64-bit via “Control Panel” ⇒ System ⇒ Under the “System Type”.
Step 2: Install JDK and JRE

Run the downloaded installer (e.g., “jdk-8uxx-windows-x64.exe“), which installs both the JDK (Java Development Kit) and JRE (Java Runtime). By default, the JDK will be installed in directory “C:\Program Files\Java\jdk1.8.0_xx“, where xx denotes the latest upgrade number; and JRE in “C:\Program Files\Java\jre1.8.0_xx“.

For novices, accept the defaults. Simply click “next”…”next”… to install JDK and JRE.

Take note of your JDK installed directory (which you will need to use in the next step). Check the JDK installed directory by inspecting these folders using Windows’ Explorer.

JDK_Path.png

I shall refer to the JDK installed directory as <JAVA_HOME>, hereafter, in this article.

Step 3: Include JDK’s “bin” Directory in the PATH

Windows OS searches the current directory and the directories listed in the PATH environment variable for executable programs. JDK’s programs (such as Java compiler javac.exe and Java runtime java.exe) reside in directory “<JAVA_HOME>\bin” (where <JAVA_HOME> denotes the JDK installed directory, e.g., C:\Program Files\Java\jdk1.8.0_xx). You need to include the “<JAVA_HOME>\bin” directory in the PATH.

To edit the PATH environment variable in Windows XP/Vista/7/8:

  1. Control Panel ⇒ System ⇒ Advanced system settings
  2. Switch to “Advanced” tab ⇒ Environment Variables
  3. In “System Variables”, scroll down to select “PATH” ⇒ Edit
  4. (CAUTION: Read this paragraph 3 times before doing this step! There is no UNDO)
    In “Variable value” field, INSERTc:\Program Files\Java\jdk1.8.0_xx\bin(Replace xx with the upgrade number and VERIFY that this is your JDK’s binary directory!!!) IN FRONT of all the existing directories, followed by a semi-colon (;) which separates the JDK’s binary directory from the rest of the existing directories.
    DO NOT DELETE any existing entries; otherwise, some existing applications may not run.
Step 1(b): Download

Download “NetBeans IDE” installer from http://netbeans.org/downloads/index.html. There are many “bundles” available. For beginners, choose the “Java SE” (e.g., “netbeans-8.0-javase-windows.exe“).

Step 1(c): Run the Installer

Run the downloaded installer. Choose your installation directory (e.g., “d:\myproject“).

About Faheem

Faheem
An adaptable and responsible Software Engineer, who enjoys working with computers and the opportunity to learn new skills and work with new technologies is particularly attractive to me.

Check Also

JAVA #32 – Java application using SQL server (Part: 01)

  In this part we made the GUI front end of a Application.

Leave a Reply

Your email address will not be published.