Error JAVA_HOME set invalid directory

1

I'm trying to compile my hybrid application which I developed with ionic framework , but I found an error about the environment variable JAVA_HOME

Development using:

  • Windows 10
  • Brackets Editor
  • Firfox Developer Edition
  • Installed the jdk1.8.0_25
  • Android Studio 1.5

Environment variables

  • JAVA_HOME - C: \ Program Files \ Java \ jdk1.8.0_25

Complete error

C:\Program Files\iis express\PHP\v5.3;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\AMD APP\bin\x86;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Brackets\command;C:\Program Files\nodejs\;C:\Program Files\Windows Kits\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Java\jdk1.8.0_25;C:\Program Files\Java\jre1.8.0_73\bin;C:\Program Files\apache-ant-1.9.6\bin;C:\Program Files\Skype\Phone\;C:\Program Files\Microsoft VS Code\bin;C:\Users\pedromiguel\AppData\Roaming\npm;C:\Users\pedromiguel\AppData\Local\atom\bin;
    
asked by Pedro Miguel Pimienta Morales 08.03.2016 в 22:37
source

4 answers

1

Could you check if you did this series of steps?

Step 1: In system variables, add a new call JAVA_HOME and write it to the folder of the JDK, example:

(Not including bin folder)

C:\Program files\Java\jdk1.8.0

Step 2:

Update system variables, for that, find PATH , click to edit and add at the end %JAVA_HOME%\bin , separated by a ; example:

C:\otrascosas;mascosas;%JAVA_HOME%\bin;

Last step:

To verify that everything went well, open the console and write:

echo %JAVA_HOME%

This should throw the directory of the JDK

For more info click here

    
answered by 08.03.2016 / 23:47
source
0

In your capture I see that you have C:\Program Files\Java\{version}\bin , omit the \bin so that it is like this C:\Program Files\Java\{version}

    
answered by 08.03.2016 в 22:44
0

From the command line, use the command:

SET

to see the correct path of variable JAVA_HOME

regularly is defined as:

C:\Program Files\Java\[version]

Update:

JAVA_HOME must be the directory that contains java and not the folder \bin :

C:\Program Files\Java\jdk1.8.0_25\

The value of your environment variable JAVA_HOME is incorrect, it should be:

C:\Program Files\Java\[version]\

Change it and this same value is what you should use Ionic .

    
answered by 08.03.2016 в 23:04
0

In order to do this we must right click on our windows icon and click on system:

After that we must go to "Advanced system configuration":

Then we must go to the option of Environment Variables:

After clicking we will open a window with the existing variables and then we should do the following:

Then we click on new and we will do the following:

Name of the variable: JAVA_HOME and from there we must select the directory where our jdk is stored:

With this we finalize the creation of JAVA_HOME and just click on OK and close all the windows that we have opened. It is best to restart the computer so that it detects the new variable.

    
answered by 04.07.2016 в 10:21