How to install Java | JDK | set Environment Variables | Windows 10
How to install Java on Windows 10
What is JAVA?
Java is a High-Level Language (HLL). It is a general-purpose, class-based, object-oriented programming language that runs on billions of devices. It is used to write computer programs that run on mobile, computer, and other electronic devices. Java was developed by Sun MicroSystems in 1995 but is currently owned by Oracle.
You may also like:
How to install JDK on windows 10
How to install Java
To download and install Java on Windows 10, follow the given instruction:
- Visit the official Java website from here.
- On the official page, you will see two versions of Java, one is the Current version and the other is LTS (long-term-support) version. You have to choose the LTS (not mandatory) one because it is the most safest and stable version.
- Now choose the Java version then choose the operating system on which you have to install. You will also get multiple file types of the same JDK, choose according to your need and then click on the download link.
- Double-click on the downloaded file, and follow the on-screen instruction, simply click on the next button every time it asks to install Java on your system.
- At last click on the close button to close the setup wizard.
- To check if Java is installed successfully, Open CMD and type "java -version". It will show the installed Java version.
Note: if you get ('java' is not recognized as an internal or external command, operable program, or batch file) this error, after running the "java -version" command. You have to set the environment variable for Java.
How to set the environment variable for Java
To set the environment variable follow the given instruction:
- Open your PC's file explorer.
- Click on Program files.
- Search for the Java folder and click on it.
- Now open the folder named "jdk-17.0.41"(the current version of Java, at the time of writing this article).
- Now open the bin folder, and copy the entire path. Your path would look like this C:\Program Files\Java\jdk-17.0.4.1\bin.
- After that open the Windows search bar and search for "Edit the system environment variables" and open it.
- Once it is open, click on the "Environment Variables" button at the bottom.
- On the environment variables page, look at the "path" inside the system variables.
- Select the "path" variable and click on the edit button.
- Now inside the path page, click on the new button and paste the path, that you have copied in step 5, then click on the "ok" button and you have successfully added the Java path to the system variable.
- Now to add the JAVA_HOME variable in the system variables, click on the new button on the environment variables page.
- Name the variable same as "JAVA_HOME" and for the variable value paste the same path that you have copied in step 5, but exclude the "bin". Your path would look like this C:\Program Files\Java\jdk-17.0.4.1. Press the ok button to save.
This is how you can download and install Java on your Windows 10 machine, as well as set the environment variables.
I hope this article was helpful to you.
Thank you.

Comments
Post a Comment