Sunday, January 01, 2012

protobuf: Ant BuildException....Cannot run program "../src/protoc"

If your building probuf-2.4.1 (for Java) on non Windows environment, chances are very much for encountering following error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run (generate-sources) on project protobuf-java: An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "../src/protoc": error=2, No such file or directory -> [Help 1]

The reason in following entry inside protobuf-2.4.1/java/pom.xml As a work-a-round to this problem, open up the above pom.xml and do following replacement.

In vim - %s/..\/src\/protoc/protoc/g

For this to work, you need to successfully install protoc & it should be available on your path.

eg:
~$ protoc --version
libprotoc 2.4.1

0 comments: