Thursday 1 November 2018

How to Download, Install Java, set Environment Variables (Updated)

Java Development Kit (JDK) allows you to code and run Java programs in your Windows computer. It is recommended that you install only the latest version. But installing Java is not that straightforward Best Selenium training institute in Bangalore. This guide will help you to do that with 100% success.

First, let's check if you have Java installed in your system. To check

  1. Press Windows + R
  2. Open Command prompt by typing "cmd", hit okay
  3. In Command Prompt type "java -version", hit enter
If it shows the Java version installed in your system then you have it already.
Else it will show the message as below, you have to install it now
'java' is not recognized as an internal or external command, operable program or batch file.

Follow these steps -

Download and Install Java Development Kit (JDK) for Windows:

Download Java Software Development Kit (JDK) here -
  1. Click on download link under Oracle JDK  download link under Oracle JDK
  2. From here chose the JDK according to your system. For me it is jdk-11.0.1_windows-x64_bin.exe
  3. Once the JDK is downloaded, find the file and open it to run the installation process.
  4. Click on Next button when needed, once the installation is complete close the program.
Now again verify if the JDK is installed properly, by typing "java -version" in command prompt.

If still, it shows "'java' is not recognized as an internal or external command, operable program or batch file." message, then you have to set environment variables

How to set Environment Variables in Java: Path and Classpath

Follow these steps -
  1. Go to Control Panel
  2. Click on "System"          
  3. Click on "Advanced system settings" 
  4. Click on "Environment Variables..." 5. environment variables
  5. Under System Variables choose Path then click on "Edit" 6. system variables edit path
    Now here you have to add the Java path
    To do that find the java path in your c drive
  6. Go to C Drive > Program Files > Java > JDK-11.0.1 (this folder name will be different depending on the version of java) > bin
  7. Copy the path, it will look like this C:\Program Files\Java\jdk-11.0.1\bin (JDK version might be different)
    Now come back the System Variables Edit window (Step 5)
  8. Click on "New" to add a new Java path add a new Java path
  9. Paste the path you have just copied, click "Ok" 8. Paste the path you have just copied, click Ok
Now once again verify if the JDK is installed properly, in command prompt.
If you have followed all the steps properly, you will have it perfectly installed on your Windows system Best Selenium Training Institute in Bangalore

Read more: How to Install Selenium WebDriver in Windows