Tek Eye Logo

Tek Eye

Installing Java on Windows

For those in a hurry go to the quick start summary at the end of the article.

Note: For those looking to install the latest version of Java on a 32-bit system, Java is not longer available for 32-bit operating systems. If you require 32-bit Java use an older version of Java, version 8.

What is Java?

Java is used to write and run computer programs and applications (apps) written in the Java programming language. Java is free. To run Java programs on Windows you need to install the Java Runtime Environment (JRE), or an equivalent. To write Java programs on Windows you need to install the Java Development Kit (JDK). The JDK includes the JRE. The JDK is required for Java Integrated Development Environments (IDEs). IDEs make writing, testing and debugging software easier. Links to some IDEs are given later. For more information about Java see the What is Java? page at www.java.com.

  • The free Java Runtime Environment (JRE) is for running Java software and Java based apps.
  • The free Java Development Kit (JDK) is used for compiling and developing Java software and apps, usually in an IDE.
  • The JDK comes with JRE.

Download and Installation of Oracle's Free Java Environment

Start installing Java on Windows by going to the Java Standard Edition (SE) Downloads page. At the Java downloads page select the Java Platform (JDK) download button which looks like this:

Download Button when Installing Java on Windows

The current release of the Java JDK platform will be shown below the button. On clicking the button, a list of supported platforms will be shown.

Before selecting a download file, click the Accept License Agreement option.

From the list of download files select jdk-X.Y.Z-windows-x64_bin.exe (where X.Y.Z is the current JDK version, e.g. jdk-13.0.2-windows-x64_bin.exe).

How to Check if 32 or 64 Bit Windows

If unsure whether you are running 32-bit or 64-bit Windows use the System option in Windows to find the System type:

  • Windows 10 - Type About in the search box (acesss search on the Start screen, via the Windows key). Open the About your PC app. Alternatively, select the Settings icon, then System, and select About. Then read the System type line.
  • Windows 8.1 - System type can be accessed via PC info from the settings icon on the charm bar.
  • Other versions of Windows - Via System and Security from Control Panel, under Basic Information.

Run the Java Installer

Run (or Open) the EXE download file to install the JDK. (Alternatively save the file for running offline, for example to be taken and installed on another Windows machine.) Only run executable code from trusted sources, i.e. only download the Java installer from oracle.com.

When the Java installation program runs, Windows may display the User Account Control (UAC) dialog. At the UAC dialog enter the machine admin password and select Yes.

The Java set up screens will be shown. You will need to select the Next button to get through the screens. (You shouldn't need to change any options presented. Older Java installers sometimes came bundled with a third party browser tool bar. We recommend you deselect that option if it appears). If you want to install the JDK and JRE to a different directory other than C:\Program Files\Java then select the Change button on the appropriate set up screen to enter or select a different location.

The progress bar is displayed as the JDK and then the JRE is installed.

Once installed click the Close button. (The Next Steps button opens a browser). Java is now installed and ready to run Java programs. Java source code can be compiled into programs.

Optionally Set the JAVA_HOME Environment Variable

Windows Search Gets Straight to Environment Variables

Setting the JAVA_HOME environment variable may be required because on some Windows PCs. This is because Java apps may have trouble accessing the Java JDK. To set the JAVA_HOME environment variable:

  • To access the Environment Variables in Windows go to the search box and type env then select Edit environment variables for your account.
  • Alternativley, select System and Security from Control Panel, then System. Click on Advanced system settings (under Control Panel Home on the left). On the System Properties window the Advanced tab should be set, click the Environment Variables button. You may require administrator rights to add the new environment variable setting.

Under System variables (or User variables) click the New button. Enter JAVA_HOME in Variable name then enter the path to the Java JDK in Variable value (e.g. C:\Program Files\Java\jdk-13.0.2, or the actual install location if it was changed). Enter the value for your system. Click OK to close the dialogs.

Checking that Java is Installed on Windows

If you need to check that Java has installed correctly, use the command line shell (Command Prompt aka DOS Prompt). Open a Command Prompt box:

  • Windows 10 and 8.1 - At the search box type com to find the Command Prompt.
  • Other Windows versions - In the Accessories folder select Command Prompt.
  • Alternative ways to start the Command Prompt - Start cmd.exe in the Windows/System32 directory. Or press the Windows key and R and type cmd then Enter in the Run box.

At the prompt, change directory, to the bin directory at the install location. Type java -version and press enter. If installed correctly Java will display the current version number. It is shown in the form 1.X.0_YY (where X is the release version and YY is the update number).

Version Check after Installing Java on Windows

Type exit then press Enter (Return) to close the command prompt.

Adding the Java bin directory to the end of Path environment variable is needed by some apps (see JAVA_HOME, above, for details on accessing the environment variables). E.g. adding C:\Program Files\Java\jdk-13.0.2\bin as another path entry.

Writing Java Programs

To produce Java software you need to write Java code. Use a text editor such as Windows Notepad, or even better Notepad++. Alternatively jEdit is an editor written in Java. For more productivity use an IDE. IDEs such as Eclipse, NetBeans or IntelliJ IDEA are designed to help with writing, testing and debugging programs. Programming environments BlueJ and Greenfoot are useful for beginners. All of these are free to download and use.

Powered Logo used on Installing Java on Windows

Hopefully installing Java on Windows has been easy. You are now ready to run and write Java Powered programs.

Quick Start Summary on Installing Java on Windows

  • Go to the Java SE Downloads Page.
  • Click the Java Download button.
  • Click the radio button to accept the licence.
  • Select the 64-bit (Windows x64) EXE download file.
  • Run the EXE.
  • Accept the UAC dialog.
  • Accept the Java installer prompts.
  • Press Close to exit the installer once complete.
  • Optionally set the JAVA_HOME environment variable.
  • Optionally add the Java bin directory to the Path environment variable.

See Also

  • For a full list of all the articles in Tek Eye see the full site Index.

Archived comments

Kerry Home on the 21st October 2019 said - There is no option to chose a 32 bit version.

Tek Eye's reply - Thanks, I have updated the article to account for the removal of the 32-bit version of Java.

Author:  Published:  Updated:  

ShareSubmit to TwitterSubmit to FacebookSubmit to LinkedInSubmit to redditPrint Page

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.


Articles on:

Android Programming and Android Practice Projects, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS, C# Programming, Using Windows for Programming


Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples



Tek Eye Published Projects