简体   繁体   中英

find_java64.exe -s is not recognized as an internal or external command

I've been googling for the better part of 4 hours and nothing I've tried has had any effect. This is your typical JAVA_HOME while configuring android studio on a machine for the first time problem it would appear. I've added literally everything to environment variables and path that I can think of. I've tried reinstalling JRE/JDK/Android Studio many many times. I've tried deleting .android and ..\\Local\\Temp items . I've tried running android.bat as admin. Nothing helps.

I can run find_java64.exe directly and it actually gives me the correct path, but in the batch file it says it can't find that file. The only thing I noticed is that it says "...Local\\Android\\sdk\\tools\\lib\\\\find_java64.exe" -s with two slashes instead of one after lib. That seems strange but not like it should cause it to not find it... and if I copy-paste the entire path with executable from the error line into command prompt (including the two slashes) it DOES show the JDK location correctly.

Why does the script not work if the line works in isolation? I can't do anything if this batch file isn't going to work.

Edit: I've been trying some more today. The core issue seems to be that when batch files are attempting to run other scripts/executables, windows always throws a is not recognized as an internal or external command, operable program or batch file." error. I've been tracing this through script after script from android.bat to find_java.bat. If I manually execute the command the batch file is trying to execute in command prompt, it works fine, but the batch file says it's wrong. Another suspicious thing seems to be that I cannot double click on ANY batch files in the computer. I can only open them as admin or from command prompt. Starting to think this is a very computer-specific problem.

If anybody else is seeing this, there's a real problem on your system when you can't launch a BAT file by double clicking it.

Something you could test on your machine is drop into a cmd shell then using the ftype and assoc builtins to check these are the defaults:

➜ ~\scoop\apps\android-sdk\current\tools\lib $ cmd
Microsoft Windows [Version 10.0.19041.572]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\cwalsh\scoop\apps\android-sdk\current\tools\lib>assoc .bat
.bat=batfile

C:\Users\cwalsh\scoop\apps\android-sdk\current\tools\lib>ftype batfile
batfile="%1" %*

If it's still broken you might need to dive into the registry and figure out why the .BAT file extension has a different program associated with it.

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