Ant BuildException Cannot run program “..\src\protoc”

Written by

in

Error that I am getting when trying to run mvn test on google protobuf library.

[INFO] Executing tasks
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "..\src\protoc": CreateProcess error=2, The system c
annot find the file specified

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch

I did place protoc.exe in the src directory. As a side note this is running on windows machine.

Quick solution that I found was to edit the pom.xml file and modify the Ant tast into

      
                

Comments

7 responses to “Ant BuildException Cannot run program “..\src\protoc””

  1. ratish Avatar
    ratish

    Hi,

    It worked for me too. Changed the executable, in my case from mvn to mvn.bat
    Thanks,
    Ratish

  2. Dimitar Stefanov Avatar

    10x
    I wouldn’t have be able to do it, alone!

    I was screaming into the monitor, already.

    It’s not documented at all, how to compile this .jar thing:
    So just use Maven in protobuf-2.4.1\java , but first put the protoc in protobuf-2.4.1\src.

  3. Fuzzy ANalysis Avatar
    Fuzzy ANalysis

    Lifesaver! Thanks so much.

    P.S. you will also need to change the reference to protoc.exe wherever you see

    … in the .pom file, if you want to do other things (test etc).

    Cheers 🙂

  4. Jayasree Avatar
    Jayasree

    I have protoc.exe file in src folder.
    And also I mentioned the path to protoc in pom.xml as “../src/protoc.exe”.
    I am still getting the same error.
    I am running in windows.

  5. anon Avatar
    anon

    lie, doesn’t work at all. still gives the same error

    1. Greg Avatar

      I am sorry that you feel that way.

  6. Ömercan Avatar
    Ömercan

    Its work man. Thank you so much. Lifesaver !!!

Leave a Reply

Your email address will not be published. Required fields are marked *