how to install java and set the path

JAVA

To install java go to the website java Download

its better to download the latest version. you can download the required version from the above link.

install the java into your machine.

and now check the version of the java by running the following command in the command prompt java -version

If you get the version then congratulations you have successfully downloaded the java into your machine and have already set the path.

If you doesn't get the java version and instead of version if you the message like java is not recognized as internal or external command,operable program or batch file then you need to set the path.

To set the path follow the below procedure...

we can set the path as local as well as global. the advantage of setting the path as global is we can able to use it from any location from the machine.

To set the path as local, open the command prompt set the path by running the command set path=C:\Program Files\Java\jdk-11.0.14\bin;%path%;

In my case the java is located at this location. C:\Program Files\Java\jdk-11.0.14\bin and %path% is for not to delete the other paths which have already set by default or by manually.

To set the path globally

copy the java path in my case C:\Program Files\Java\jdk-11.0.14\bin now open control panel and click on system and security

now click on the advanced system settings then you will find the Environment variables button below.

click on Environment variables and here you will find the two halfs. i.e., user settings and system settings.

In both settings you will find the Path named value click on that and then press edit option below, and now paste the java bin link and apply and close it.

Note: If you pasted the java link in user settings it is for particular user only. and if you pasted the java path in system settings then java can be used globally and any user of your system can use the java.


Tips:

  you can use the command cls in command prompt to clear the screen.



No comments:

Post a Comment