Java Environment Variables

0 votes

Can someone list the steps that are required to setup the environment variables in Windows OS?

May 29, 2018 in Java by 93.lynn
• 1,600 points

2 answers to this question.

0 votes

In order to set up the environment variables, first, you need to download and install the latest JDK version. You can download this from here:

You can look for the file according to your system configurations.


Once you are done, you can find the Java root folder here: C:\Program Files

Now to set the environment variables:

  1. Right click on “My Computer” and go to the properties.

  2. In System properties windows, click on the Advanced tab.

  3. In this tab, click on” Environment Variables”.image

  4. Click on new to add new variable:image

  5. Now add the below variables one by one:

    1. JAVA_HOME : C:\Program Files\Java\jdk1.8.0_112

    2. JDK_HOME  : %JAVA_HOME%

    3. JRE_HOME  : %JAVA_HOME%\jre

    4. CLASSPATH : .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib

    5. PATH      : your-unique-entries;%JAVA_HOME%\bin

  6. Once done, click on “OK” and exit.

answered May 29, 2018 by code.reaper12
• 3,500 points
0 votes

--- To set java path ---

There are two ways to set java path

A. Temporary

  1. Open cmd
  2. Write on cmd


If java is not installed, then you will see message:

javac is not recognized as internal or external command, operable program or batch file.

  1. write on cmd : set path=C:\Program Files\Java\jdk1.8.0_121\bin
  2. then write on cmd : javac you will find path is set

B. Permanent

  1. Go to "my computer" properties
  2. Click on "Advanced system settings"
  3. Click on "Environment variables"
  4. Click on new tab of user variable
  5. write path in variable name
  6. copy the path of bin folder
  7. paste path of bin folder in variable value
  8. click OK button
  9. permanent path is set now.
answered Dec 3, 2018 by Sushmita
• 6,910 points

Related Questions In Java

0 votes
1 answer

How can we set environment variables from java?

For setting the environment variable, you can ...READ MORE

answered Jun 21, 2018 in Java by Akrati
• 960 points
0 votes
6 answers

How can we define global variables in java?

To define Global Variable you can make ...READ MORE

answered Dec 15, 2020 in Java by Gitika
• 65,910 points
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 80,075 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,220 points
+4 votes
3 answers

What are the steps to set Java_home on Windows?

Set Java Home JAVA_HOME = C:\Program Files\Java\jdk1.7.0 [Location ...READ MORE

answered Sep 18, 2018 in Java by Sushmita
• 6,910 points
0 votes
1 answer

What is Classpath in java?

Classpath is a parameter in the Java virtual machine or ...READ MORE

answered Jun 5, 2018 in Java by Daisy
• 8,120 points
0 votes
3 answers

Setting JAVA_HOME in linux

Hello fellow techies, Assuming you use bash shell ...READ MORE

answered Dec 10, 2020 in Linux Administration by Rajiv
• 8,910 points
0 votes
0 answers

Eclipse "Error: Could not find or load main class"

I have a project on my laptop ...READ MORE

May 7, 2022 in Java by narikkadan
• 63,700 points
0 votes
1 answer

ThreadLocal variables usage in Java

public class Test { // ...READ MORE

answered Jun 30, 2018 in Java by code.reaper12
• 3,500 points
0 votes
1 answer

Purpose of “String args[]” in the “psvm” of Java

Let me give you the complete explanation ...READ MORE

answered May 7, 2018 in Java by code.reaper12
• 3,500 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP