• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

SoftwareTestingo - Interview Questions, Tutorial & Test Cases Template Examples

SoftwareTestingo - Interview Questions, Tutorial & Test Cases Template Examples

  • Home
  • Test Case Examples
  • Interview Questions
  • Interview Questions Asked
  • Java
  • Selenium
  • Manual Testing
  • SQL Tutorial For Beginners
  • Difference
  • Tools
  • Contact Us
  • Search
SoftwareTestingo » Java » Java Tutorial » How to Set Java_Home Variable On Windows 10 Step By Step?

How to Set Java_Home Variable On Windows 10 Step By Step?

Last Updated on: April 22, 2023 By Softwaretestingo Editorial Board

What We Are Learn On This Post

  • Prerequisites For Set Java_Home
  • For Verify Java Version:
  • How do I set my Java_home?
  • What is the Java_home path?
  • Why should I set Java_home?

Set Java_Home Variable On Windows 10: In this post, we will learn how to set the JAVA_HOME variable on Windows 10. Before that, If you have not installed the latest versions of Java on your machine, you can check our blog post on how to install Java on Windows 10; then you can refer to this article.

After successfully installing Java on your local machine, you can follow up on this guide to set up the Java_Home Variable On Windows 10 system. Because if this variable is not configured properly, then when you run your Java program, you will get the errors.

So after installing the JDK on your machine, run the Java command java -version to know the installed Java version. If you are getting any errors, then follow the below steps.

Prerequisites For Set Java_Home

  • Java Should Be Installed, and If Java is not installed on your system, then you can follow this post for Java 64-bit installation on Windows 10 machine.
  • Windows Should Installed in You System

If on your system, Java is not installed then, Follow the below Step To Configure the Java_Home so that we can run java command anywhere in our system.

  • First, we need to search advanced system settings in the search box and click on View Advanced System Settings

Advanced System Settings
Advanced System Settings

After clicking on view Advanced system settings, you will get a window System properties.

Advance System Settings
Advance System Settings

In System variables, add a new JAVA_HOME by clicking on New, and after that, enter the Variable Name as JAVA_HOME and Variable Name as C:\Program Files\Java\jdk1.8.0_92 to point into the JDK installation folder.

System Variable
System Variable

Note:

1. Correct: C:\Program Files\Java\jdk1.8.0_92
2. Wrong: C:\Program Files\Java\jdk1.8.0_92\bin

  • After setting the JAVA_HOME in the system variable, you need to set the path in the Path variable. So for an update, the path variable clicks on the path variable after the click on edit. After Clicking on the edit button, you will get another new window, “Edit Environment Variable”, and there you need to update the path details with \bin so that the complete path will look like this.
    %JAVA_HOME%\bin

Verify Java Installed:

To verify whether Java is installed in your system, you need an open command prompt and try the below commands

For Verify Java Version:

Open the command prompt and enter java -version

C:\Users\******>java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

C:\Users\****>javac -version
javac 1.8.0_92

To find out the Java installation directory details try the below command

C:\Users\*****>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_92

How do I set my Java_home?

We can set the Java_home by goto the environmental variables of the Windows machine and mentioning the Java installation directory.

What is the Java_home path?

Environment variables are strings that contain information such as drive, path, or file name. The JAVA_HOME environment variable points to the directory where the Java runtime environment (JRE) is installed on your computer.

Why should I set Java_home?

By setting the environment variable JAVA_HOME, you specify where the JRE and all those runtime resources are to be found. You should ensure that the particular Java you execute matches the setting of JAVA_HOME.

    Filed Under: Java Tutorial

    Reader Interactions

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Primary Sidebar

    Join SoftwareTestingo Telegram Group

    Categories

    Copyright © 2023 SoftwareTestingo.com ~ Contact Us ~ Sitemap ~ Privacy Policy ~ Testing Careers