Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: luanch of executable from within .bat file fails  (Read 18470 times)

0 Members and 2 Guests are viewing this topic.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: luanch of executable from within .bat file fails
« Reply #15 on: November 27, 2014, 07:37:19 AM »
Some tool called two files the same name and put them in the same folder.
Yes it can work, but no, it's not a good plan.
Quote
The executable find_java.exe, which the message references, is actually called from within find_java.bat, both of which are in the tools\lib folder.
I'm not sure which chicken or egg came first here.

'"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command, operable program or batch file.



Failed to execute tools\android.bat


Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: luanch of executable from within .bat file fails
« Reply #16 on: November 27, 2014, 09:27:24 AM »
Try running a call "%~pds0\find_java.exe" -s or start "%~pds0\find_java.exe" -s.  That might fix the issue.  Are you swapping drives between the .bat and find_java.exe?
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

Jerry Ford

    Topic Starter


    Rookie

    • Experience: Expert
    • OS: Windows 7
    Re: luanch of executable from within .bat file fails
    « Reply #17 on: November 27, 2014, 12:31:58 PM »
    foxidrive:  Yeah, I know, same name, different extensions?  Probably written by someone more experienced with Linux/Unix programming than Microsoft. Also note that the command cited in the error message---D:\dev\android\sdk\tools\lib\\find_java.exe---fails only when run from within the SDK files.  If I enter that on a command line, it returns a string containing a path to the java.exe, as it is supposed to do:

    D:\dev\android\sdk>d:\dev\android\sdk\tools\lib\\find_java.exe
    C:\ProgramData\Oracle\Java\javapath\java.exe

    But if I change the command line to run the .bat file instead of the .exe, the .bat file runs but fails on the call to run the .exe...

    D:\dev\android\sdk>d:\dev\android\sdk\tools\lib\\find_java.bat
    'start "d:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
    operable program or batch file.

    Lemonilla: 

    > Try running a call "%~pds0\find_java.exe"

    Did you mean ~dps0?  I tried with both call and start, still fails.

    foxidrive/Lemonilla:  Thing is, all of these files do work in other Windows environments, just not my particular machine. 

    Since they do run without error on some machines, I am not convinced my problem is a syntax thing in the bat files. 

    I'm currently thinking some permission setting was set on the original files or directories (Linux/Unix vs Microsoft again) and somehow on my system there is a conflicting security setting.  At least, that's my current best guess.

    Jerry

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: luanch of executable from within .bat file fails
    « Reply #18 on: November 27, 2014, 01:42:38 PM »
    https://groups.google.com/forum/m/#!forum/android-developers
    I think you would be better off getting help on the Google group.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: luanch of executable from within .bat file fails
    « Reply #19 on: November 27, 2014, 02:04:02 PM »
    Just an observation.
    It does run on some machines with similar setups.
    Therefore, if it were me, I would put do the project on a spare backup system keep for just that kind of scenario. I would do a fresh install of Windows and and then  install all stuff needed for the project. That is a "brute force" method that take a few hours. In contrast, fining the exact error make take days.

    Not really my idea. Credit is to Alexander the Great.
    To Cut the Gordian Knot
     :)

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: luanch of executable from within .bat file fails
    « Reply #20 on: November 27, 2014, 04:41:25 PM »
    foxidrive/Lemonilla:  Thing is, all of these files do work in other Windows environments, just not my particular machine. 

    Jerry, with access to the machine it would probably take less than 5 minutes to see why it fails.

    To do it here we have to test things bit by bit - put this in a batch file called testme.bat and run it in the folder with find_java.exe and see what it prints. 

    Code: [Select]
    @echo off
    for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do echo "%%a"
    pause

    Jerry Ford

      Topic Starter


      Rookie

      • Experience: Expert
      • OS: Windows 7
      Re: luanch of executable from within .bat file fails
      « Reply #21 on: November 30, 2014, 12:36:04 PM »
      foxidrive:

      Sorry, your reply requesting results of a run of your testme.bat got shunted to my spam folder and I did not see it until just now.

      Here's the output...

      D:\dev\android\sdk\tools\lib>testme
      '"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
      operable program or batch file.
      Press any key to continue . . .


      Jerry

      Jerry Ford

        Topic Starter


        Rookie

        • Experience: Expert
        • OS: Windows 7
        Re: luanch of executable from within .bat file fails
        « Reply #22 on: November 30, 2014, 12:41:04 PM »
        Squashman:

        > I think you would be better off getting help on the Google group.

        Thanks for the link. I am pursuing that avenue.

        But I don't think it is necessarily a Google/Android problem.  The Android tools do work. There's just something in my Microsoft environment that is preventing them from working on my machine. That seems to suggest the fix is in the Microsoft environment.

        Jerry

        Geek-9pm


          Mastermind
        • Geek After Dark
        • Thanked: 1026
          • Gekk9pm bnlog
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: luanch of executable from within .bat file fails
        « Reply #23 on: November 30, 2014, 12:57:52 PM »
        ....
        But I don't think it is necessarily a Google/Android problem.  The Android tools do work. There's just something in my Microsoft environment that is preventing them from working on my machine. That seems to suggest the fix is in the Microsoft environment.
        ...
        Which is why I suggested using another PC with a fresh install just to see. Or the  OP could just shrink the Hard Drive and make another partition and install a basic copy of windows.

        Jerry Ford

          Topic Starter


          Rookie

          • Experience: Expert
          • OS: Windows 7
          Re: luanch of executable from within .bat file fails
          « Reply #24 on: November 30, 2014, 05:19:16 PM »
          Geek:

          I have already installed it on a separate Win7 system, and yes it does work.  What I don't know is what is the difference in the two setups.

          The obvious difference--Win7 Ultimate vs. Win7 Home Pro---seems to be not significant.  I have been told by an engineer at Google the the software works fine on his Win7 Ultimate machine, which he set up in response to my issue.

          So, I have done what you advised---demonstrated that it works on other Win7 setups.

          So that means it must be a Windows environment thing, right? But which thing? Where to fix?

          Jerry

          Geek-9pm


            Mastermind
          • Geek After Dark
          • Thanked: 1026
            • Gekk9pm bnlog
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: luanch of executable from within .bat file fails
          « Reply #25 on: November 30, 2014, 05:40:10 PM »
          OK. This is the way to solve tough problem. You divide and conquer.
          You now know for yourself it does work and you can compare the two environments.
          Look at the environmental values for both computers.
          How to they differ?
          What about he path setting for both machines?
          Last, compare the registry of both machines.
          Here is a link that might relate to how to differentiate registry settings.
          http://support.microsoft.com/KB/171780
          Quote
          SUMMARY
          How can you compare registry entries before and after an upgrade, the installation of a new software package, or between two computers?
          Doing a registry study is as much  fun as doing memory dumps.
          - OR -
          Just use the machine that works.
          Fix the mystery later.  :)

          Squashman



            Specialist
          • Thanked: 134
          • Experience: Experienced
          • OS: Other
          Re: luanch of executable from within .bat file fails
          « Reply #26 on: November 30, 2014, 06:12:14 PM »
          foxidrive:

          Sorry, your reply requesting results of a run of your testme.bat got shunted to my spam folder and I did not see it until just now.

          Here's the output...

          D:\dev\android\sdk\tools\lib>testme
          '"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
          operable program or batch file.
          Press any key to continue . . .


          Jerry
          that should not be possible if find_java.exe is in the same folder as the batch file.

          Jerry Ford

            Topic Starter


            Rookie

            • Experience: Expert
            • OS: Windows 7
            Re: luanch of executable from within .bat file fails
            « Reply #27 on: November 30, 2014, 07:46:51 PM »
            > that should not be possible if find_java.exe is in the same folder as the batch file.

            And therein lies my dilemma. 

            The .exe is in fact in the same folder as the .bat file. 

            If I open a command window and cd to d:\dev\android\sdk\tools\lib and run .\find_java.bat, I get the "find_java.exe...is not recognized as a...command" error...

            D:\dev\android\sdk\tools\lib>.\find_java.bat
            'start "D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
            operable program or batch file.

            And yet, if I run .\find_java.exe from that very same command line, the .exe runs successfully, returning the path to java.exe as a string...

            D:\dev\android\sdk\tools\lib>.\find_java.exe
            C:\Program Files\Java\jdk1.8.0_11\bin\java.exe
            D:\dev\android\sdk\tools\lib>

            Jerry

            Geek-9pm


              Mastermind
            • Geek After Dark
            • Thanked: 1026
              • Gekk9pm bnlog
            • Certifications: List
            • Computer: Specs
            • Experience: Expert
            • OS: Windows 10
            Re: luanch of executable from within .bat file fails
            « Reply #28 on: November 30, 2014, 08:12:24 PM »
            The problem is in the SDK. This was documented elsewhere.
            The OP needs to check which versions he has.
            http://stackoverflow.com/questions/26293528/error-launching-sdk-manager-find-java-exe-is-not-compatible-with-the-version-o
            Quote
            You don't say in your question, but it sounds like you have recently updated your SDK to 23.0.4. If that's the case, there's a bug in the release documented here:

            https://code.google.com/p/android/issues/detail?id=77289

            The bug is that there was a bad version of the find_java.exe utility shipped with that version. This is fixed in 23.0.5, which is out now.

            Jerry Ford

              Topic Starter


              Rookie

              • Experience: Expert
              • OS: Windows 7
              Re: luanch of executable from within .bat file fails
              « Reply #29 on: November 30, 2014, 08:18:22 PM »
              > The problem is in the SDK. This was documented elsewhere.

              Any clues as to when or where this was documented?  I've been scouring the internet, asking everybody, including Google, and nobody has yet been able to tell me what the problem is, or what in the SDK is at fault.

              > The OP needs to check which versions he has.

              Sorry for my ignorance, but what do you mean by OP? and which versions of what?

              Jerry