CreateProcess error=2, The system cannot find the file specified [Android studio]
I got this same error on android studio 3.1 which I've just now updated. user3235168's answer worked for me.
Additionally I had to remove the check mark from 'Use embedded JDK(recommended)' Then browse to jdk's path - C:\Program Files\Java\jdk1.8.0_144
Since android studio is still referring to jdk1.7.0_40 change its path
Goto Files->Other Settings->Default Project Structure.
Under Platform Settings Select Android sdk...under JDK location change C:\Program Files (x86)\Java\jdk1.7.0_40 to C:\Program Files\Java\jdk1.7.0_45
That should do the trick :)
I hope this answer can be a reference for new comer!
I got same issue and I stuck for this error!
Finally I got solution here!
After I explore the error detail, I got message that there are issue with NDK. Try to disable NDK or add the following code in your gradle.build
packagingOptions{
doNotStrip '*/mips/*.so'
doNotStrip '*/mips64/*.so'
}
Try the following: Open a new commandline (Win+R => cmd.exe) and enter "java". I predict that you'll get an error that says something like "command not found". The reason for this is that you don't have an windows environment variable set for your java.exe.
Do so by Win+X => System => Advanced System Settings => Advanced => Environment variables => search for PATH under the system variables => edit => append the path to your java.exe sperarated by ;
For example: ../other/pathes/with/file.exe;C:\Program Files (x86)\Java\jdk1.6.0_45\bin
Save,close,restart