User:Taha6878/sandbox

How to download and install Java and set environment variable

how to install java: we are going to learn how to install java and how to set up environment for running java programs.

First of all we will discuss what is the software requirement for running Java program so friends we need Java development kit JDK to run java program there are various version of JDK available but you always have to use the latest version of JDK on the time of this recording the latest version of JDK is JDK 13.0.1 so let's download this JDK version and then move ahead for setup Java environment to download JDK you need to search Java download on google

There will be a link of oracle website will be appeared click on this link oracle website will be open and here you can see you can download the java latest version that is java 13.0.1 click on the download button and then you need to accept the license agreement and according to your operating system you can download.

This will take some time to download after downloading Java just click on the JDK icon to start installation.Then it ask you the permission to install press YES and after some background process

The dialog box is appear press Next and we want to installed development tools click on next and after some process Java will be installed when Java is successfully installed there will be a message appeared that Java standard edition development kit is successfully installed.

Then press close to close this dialog box after the installation to check whether the Java is installed successfully or go to your C Drive then Program Files then Java JDK 13.0.1 and bin these folders are found and in the bin folder you can see all tools like Java Java C that are used to compile or run the Java program are found here in this way you are ensure now that your Java is installed.

How To set Environment variable in JAVA : PATH and CLASSPATH

The Path variable gives the location of executable like java. It is possible run a program without specifying the path, You will need to give full path of executable looks like :C:\Program Files\Java\jdk1.8.0_131\bin\javac A.java

The ClassPath variable give location of the library files.

Let's Look into the steps

(Step 1) Go to Desktop Right click on MY COMPUTER & Select Properties.

(Step 2) Click On Advance System Settings.

(Step 3) Click On Environment Variables.

(Step 4) Click on NEW Button of user variables.

(Step 5) Type PATH In VARIABLE name.

(Step 6) Copy the BIN Folder which is installed in JDK folder.

(Step 7) Paste BIN Folder in variable value & click ok Button.

(Step 8) Follow a similar process to set ClassPath.

NOTE : In case your JAVA does not work after installation, change CLASSPATH to

CLASSPATH = \lib\tools.jar;

(Step 9) After Set CLASSPATH Click on Ok Button.

(Step 10) Open command Prompt, and type JAVAC

You see a screen like below, java is installed.

Sources : Applications Development