Take the 2-minute tour ×

Google protocol buffer/java

I am new to maven and Google Protocol Buffer.

I followed all the README instructions and successfully built the files with Maven.

I got all the files in


(what is the use of this?) The test cases run fine.

I compiled the meta data in the proto file and got the class files generated automatically here:


I created two java files: AddPerson.java and ListPeople.java from the code in the tutorial.

eclipse screenshot

I am not able to execute it. Where did I go wrong?


The method mergeFrom(Message) from the type AddressBookProtos.AddressBook.Builder refers to the missing type Message

the second error:

The method writeTo(CodedOutputStream) from the type AddressBookProtos.AddressBook refers to the missing type CodedOutputStream

These are from the AddPerson.java

AddressBookProtos.java has 100's of errors

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Looking at your screen shot it does not look like you have imported the generated classes to your project. Add all generated .java files to the correct location in your src folder and re-try.

share|improve this answer
I put the generated .java files. Even then I had problems. "package com.google.protobuf.DescriptorProtos does not exist. Then I ran the protoc on descriptor.proto and got the files. Hope this helps someone with similar issues. –  redmave Aug 17 '11 at 19:43
You are right redmave. The DescriptorProtos file has to be created to fix the compilation errors. This worked out for me as well. Thank you. –  Bouncing Bit Aug 1 '12 at 7:29
add comment

You have a compilation error. Hold your cursor over the error in the IDE (Eclipse) and post the error message.

share|improve this answer
I posted the error messages in EDIT –  redmave Aug 17 '11 at 15:58
add comment

First I don't know anything about this google project but anyways. If its maven try this in the command prompt where your pom.xml is.

mvn eclipse:eclipse

It should generate project files then import the project in eclipse.

share|improve this answer
add comment

Your Answer


