1

When we set the environment path, can't it work correctly for Java, Eclipse and Android Studio?
How to set it correctly?

When I set it temporarily by using the command prompt, set path is not working correctly.
So I tried to set it permanently by using the environment variable Path, but it's not possible.

How can I set it properly?
Please give me a detailed explanation

vijay
  • 486
  • 5
  • 17
Hackbal Teamz
  • 1,060
  • 13
  • 21

2 Answers2

1

Apart from setting the JAVA_HOME system variable you need to set the Path variable as well because the Path is the system variable that your Operating system uses to locate the needed executable from the terminal window.

So for setting the Path Variable proceed as follows:

  • Right click on the My Computer icon --> Properties -->Advanced system settings --> Environment Variables
  • Now under System variable scroll to the Path variable
  • Select Path variable and click on edit button
  • Now add %JAVA_HOME%\bin in the end of Variable values, separating this value form the existing one in the list with a ; eg xxxxx;%JAVA_HOME%\bin;

Note that before following the above steps also check if your JAVA_HOME variable is properly set. For doing this go to command prompt and type echo %JAVA_HOME%. If it is properly set then it will give you the path of your jdk.

NOTE: Sometimes it happens that both the Path and JAVA_HOME variables are set properly but still things are not working.To avoid this run the command prompt as administrator.

amit
  • 747
  • 5
  • 12
0

Android Studio uses JAVA_HOME variable , not Path variable. So You should set up JAVA_HOME Variable.

  • Right-click the My Computer icon on your desktop and select Properties
  • Click the Advanced tab. Click the Environment Variables button.
  • Under System Variables, click New.
  • Enter the variable name as JAVA_HOME.
  • Enter the variable value as the installation path for the Java Development Kit.

Note:Normally installation path is like "C:\Program Files\Java\jdk1.7.0"

prasadmadanayake
  • 1,395
  • 13
  • 22