Quantcast
Channel: TEKDigest » Tutorials
Viewing all articles
Browse latest Browse all 5

How to Install Java on Windows

$
0
0

I am sure there are many tutorials available on ‘How to Install Java on Windows’,  and here I have written a step by step tutorial with screenshots to install the Java in your Windows machine.

Java Development Kit (JDK) can be downloaded from Oracle – Java SE Download site freely in order to develop Java Applications and Applets.

What is JDK and JRE?

JDK  – Is a ‘Java Development Kit’ which also includes JRE and development tools (like Compiler and Debugger) is required for developing Java Applications and Applets.

JRE – Is a ‘Java Runtime Environment’ is required for running  Java Applications and Applets.

So which one to install?

If you are writing Java programs, then you are required to install both the JDK and JRE

Un-Install the older version(s) of Java (JDK/JRE)

You can have multiple versions (old and new) of Java in your machine. But it is always recommended to un-install the older version of Java and install the current version of Java.

This tutorial applicable to Windows XP, Windows 7 (32 bit and 64 Bit), and Windows 8

Step 1: To Download the JDK go to Oracle – Java SE Download site

Java Download3 How to Install Java on Windows

Step 2: Click on the ‘Download’ button under ‘JDK’ of  ‘Java SE 7

JDK7 Download1 How to Install Java on Windows

Step 3: In the next page ‘Accept License Agreement’ and select your operating system type (32 bit or 64 bit)

32-bit Windows OS – Windows x86

64-bit Windows OS – Windows x64

OS Type1 How to Install Java on Windows

From the above link I have downloaded ‘Windows x64′ for my Windows7 64 bit for demo purpose.

JavaExe1 How to Install Java on Windows

Step 4: Install JDK and JRE

Run the downloaded installer ‘e.g: jdk-7u9-windows-x64.exe, which installs both the JDK (Java Development Kit) and JRE (Java Runtime Environment).

Java Download11 How to Install Java on Windows

By default, the JDK will be installed in directory “C:Program FilesJavajdk1.7.0_09″; and JRE in “C:Program FilesJavajre7″.

Java Download21 How to Install Java on Windows

For now, accept the defaults and click “next” to install JDK in “C:Program FilesJavajdk1.7.0_09” and JRE in “C:Program FilesJavajre7“.

Once the installation completes you would see this screen and click on Close.

Java Download Complete11 How to Install Java on Windows

Take note of your JDK installed directory - C:Program FilesJavajdk1.7.0_09.

Java Installed Directory1 How to Install Java on Windows

From now on wards refer to the JDK installed directory as <JAVA_HOME> in this article.

Step 5: Verify the JDK Installation on your Windows Machine

Launch the Command (CMD) prompt.

Start ->’Search programs and files’ for CMD

Issue the following commands to verify that JDK is properly installed and display its version:

Java Verify Version1 How to Install Java on Windows

If you see similar to above screen; then the Java is installed properly on your machine.

You can also check this is in the Installed Programs and Features –> from Control Panel

Step 6: How to Set Java PATH

Windows Operating System searches the current directory and the directories listed in the PATH environment variable for executable programs.

Step A: Go to ‘Control Panel’ (Example: This demo is on ‘Windows 7 64 bit’)

Step B: Click on the ‘System’ Item

Step C: Click on the ‘Advanced system settings’

Step D: Click on the ‘Advanced’ Tab

Step E: Click on the ‘Environment Variables’ Tab

Step F: Under ‘System variables’ -> search for PATH variable ->Click on ‘Edit’ Tab

Here you need to copy the whole path of bin folder:

For Example: C:\Program Files\Java\jdk1.7.0_09\bin

In the ‘Variable Value’ field, insert the path; in-front of all the existing variable path followed by a semi-colon “;”  that separates the JDK’s binary directory from the rest of the existing directories path.

Java Path Variable1 How to Install Java on Windows

Step 7: Verify the Java path set properly

Open the Command Prompt ->Start -> ‘Run’ or ‘Search programs and files’ for “CMD”.

Issue the “path” command to see the content of the PATH environment variable.

Verify the output and make sure that “C:Program FilesJavajdk1.7.0_09bin” is listed in the PATH.

Java Path Variable1 How to Install Java on Windows

NOTE: Your Java PATH variable needs to set in-front of all the existing variable path followed by a semi-colon “;” , this is because there might be a conflict with your other jre installed versions.

NOTE: Setting Java PATH variable also helps in resolving the ‘AVD Manager Installer’ issue.

AVD Manager Installer complains that Java not installed; if the Java PATH variable is not set

Android SDK21 How to Install Java on Windows

If the Java PATH variable is set ‘AVD Manager Installer’ installation can be continued

Android SDK11 How to Install Java on Windows

Finally, restart your machine.



Let me know If you have any questions.

If you liked this article, please share this article on Facebook and Google+.



How to Install Java on Windows is a post from: TEKDigest

The post How to Install Java on Windows appeared first on TEKDigest.


Viewing all articles
Browse latest Browse all 5

Trending Articles