Installing Java on Windows (32-Bit or 64 Bit)
For those in a hurry go to the quick start summary at the end of the article.
Java is used to write and run computer programs and Apps. To run Java programs on Windows you need to install the Java Runtime Environment (JRE). 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.
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:
The current release of the Java JDK platform will be show below the button, for example 8u72 (for release 8 update 72). 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 the appropriate Windows option, either:
To install Java on Windows 32-bit (Windows x86) select jdk-XuYY-windows-i586.exe (where XuYY is the current JDK version, e.g. jdk-8u72-windows-i586.exe).
To install Java on Windows 64-bit select jdk-XuYY-windows-x64.exe (e.g. jdk-8u72-windows-x64.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 - Select Settings then System. Select About and 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 (Open) the selected EXE file to install the JDK. (Alternatively save the file for running offline, for example to be taken and installed on another Windows machine.) Please only run executable code from trusted sources. Only download the Java installer from oracle.com.
When the Java installation program runs Windows will display the User Account Control (UAC) dialog. At the UAC dialog 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 JRE and JDK to a different directory other than C:\Program Files\Java then select the Change button on the appropriate set up screens to enter or select a different location.
The progress bar is displayed as Java is installed.
Once installed click the Close button. (The Next Steps button opens the 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
Setting the JAVA_HOME environment variable may be required because on some Windows installations Android Studio and the SDK tools have trouble accessing the Java JDK. To set the JAVA_HOME environment variable select System under System and Security from Control Panel. 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. To quickly access the Environment Variables in Windows go to the Start screen (press the Windows key) and type env then select Edit environment variables for your account, 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\jdk1.8.0_72, or the actual install location if it was changed). Click OK to close the dialogs.
Checking that Java is Installed on Windows
If you need to check that Java has installed use the command line shell (Command Prompt aka DOS Prompt). Open a Command Prompt box:
- Windows 10 and 8.1 - At the Windows Start Screen 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 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).
Type exit then press Enter (Return) to close the command prompt.
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.
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 Download button.
- Click the radio button to accept the licence.
- Select the 32-bit or 64-bit Windows EXE download file as appropriate.
- 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.
Author:Daniel S. Fowler Published: Updated: