0

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.

indiv
  • 17,306
  • 6
  • 61
  • 82
user986122
  • 365
  • 5
  • 16
  • Is the directory that find_java64.exe is in located in the %PATH% variable? It needs to be. Or you need to run the batch file from the same directory that find_java64.exe is in. – SomethingDark Apr 24 '15 at 04:53
  • a stupid question ,but did you confirm the jdk version and try [modifying the studio.bat manually](http://stackoverflow.com/a/25054118/3396197) – Droidekas Apr 24 '15 at 05:02
  • Please post the code of your bat file. – MichaelS Apr 24 '15 at 07:54
  • I added it to the path, haven't looked at studio.bat but I'll take a look! android.bat ships with android studio and I haven't modified it. – user986122 Apr 24 '15 at 17:34

1 Answers1

0

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.

Carl Walsh
  • 6,100
  • 2
  • 46
  • 50