Part A: Directly download from the website


Step 1: Download JDK from the Oracle website compatible with your Operating system.
Step 2: Click on Accept License Agreement and download the software.
Step 3: Just click next to continue. Choose the path where you want to install it.
Step 4: Check if it is properly installed on or not. Press Windows + R or click on start and type 'Run'. Type cmd on it. OR Press 'Shift+Right Click on desktop' and select 'Open command window here'.
Command Prompt window will open. Just type 'java -version'. If you see the below screen, Java is installed successfully.



Part B: Installing java via a folder


Step 1: Copy the folder into C drive. Make sure it has JDK and JRE folder.
Step 2: Right click on the “My Computer” icon and go to properties.

 Go to the "Advanced settings" tab
click on "Environment variables".

 In the "System variables" box select the variable "Path"and click the button "Edit" below that box.
Step 4: A new window opens. In the "variable value" field, type the path of the bin folder of the JDK followed by semicolon (;). For example if the JDK is installed in "C" drive itself the path to be given ";C:\Program Files\Java\jdk1.8.0_20\bin".


Write and Run a program:

Program:


import java.util.*;
class Hello
{
 public static void main(String args[])
 {
  System.out.println("Hello World");
 }
}


Save this program as Hello.java on the desktop.

Execution:


Enjoy Programming !!

No comments :

Post a Comment