JAVA_HOME is installed in an invalid directory:

I installed JAVA_HOME on my system C:\Program Files\Java\jdk1.8.0_ 131\bin; and I try to run the cordova command (cordova assembly) on the command line, but I get the error message below. I tried all the methods, but could not solve this problem:

ERROR: Invalid directory for JAVA_HOME: C: \ Program Files \ Java \ jdk1.8.0_ 131 \ bin;

Please set the JAVA_HOME variable in your environment according to the location of your Java installation.

+44
source share
11 answers

You must install it using C:\Program Files\Java\jdk1.8.0_12 .

\bin not required.

+69
source

JAVA_HOME should point to the jdk home directory, not jdk/bin .

You need to set JAVA_HOME like this:

 JAVA_HOME="C:\Program Files\Java\jdk1.8.0_131" 
+33
source

Remove \bin and also delete ; in the end. After restart cmd and run.

+13
source

Try the following:

  • Remove \bin from the JAVA_HOME path.
  • Open a new command prompt window.
  • Run your command as administrator.
+8
source

JAVA_HOME should be C:\Program Files\Java\jdk1.8.0_172 not include C:\Program Files\Java\jdk1.8.0_172 (;) or bin in the path. Any version of the JDK above 7 will work. Also you need to restart cmd

+4
source

set JAVA_HOME as C: \ Program Files \ Java \ jdk1.8.0_172

do not use a semicolon ";" with the above JAVA_HOME value

To verify that it is installed correctly, go to check the command line for C: .......> sdkmanager --list

A complete list appears that allows you to successfully save it.

otherwise it will show an error that the JAVA_HOME path is not set correctly.

+2
source

In window 10, the problem was with a semicolon ; ,

Go to edit the system environment variables and delete the semicolon at the end of the JAVA_HOME value C:\Program Files\Java\jdk1.8.0_144

In other words, convert this C:\Program Files\Java\jdk1.8.0_12; in C:\Program Files\Java\jdk1.8.0_12

0
source

I think you need to remove the ';' from the end of the Java path.

0
source

After setting the JAVA_HOME variable, run android studio as administrator

0
source

You need to install only with C: \ Program Files \ Java \ jdk1.8.0_12.

And check with the new cmd. Will be updated

0
source
  • Just set your JAVA_HOME path for your jdk directory, for example C:\Program Files\Java\jdk
  • You may also need to restart to update the changes.
-1
source

Source: https://habr.com/ru/post/1269962/


All Articles