简体   繁体   中英

Ionic failed to build for Android, JAVA_HOME invalid, failed to run java -version

I already tried to set my JAVA_HOME to C:\\Program Files\\Java\\jdk1.8.0_73 and the path is C:\\Program Files\\Java\\jdk1.8.0_73\\bin .

屏幕截图

The goal of what you are asking to do is to install java and let some other program find java by setting two Windows variables JAVA_HOME and path to point to the java directory and the java executable/program file directory respectively. I assume you are using windows because of some of the clues you gave. You first need to download java, get the JDK and not the JRE version. Download from here java then set the two variables, find mycomputer icon or maybe its called this pc and right click find properties click advanced system settings, environment variables there you go, put in the variable and value for both JAVA_HOME and path

I had the same problem and had solved it. The cause of problem changing the path when installing jdk. Changed jre path to

../jdk1.8.0/jre

the right is for example:

../java/jdk1.8.0
../java/jre8

or change nothing.

So, if you are sure that JAVA_HOME path is right, try to reinstall jdk and change nothing before complete.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM