开发者

Compilation error of simple java files with Google Protocol Buffer

开发者 https://www.devze.com 2023-03-28 14:20 出处:网络
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.

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

protobuf-2.4.1\java\target

(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:

com\example\tutorial\AddressBookProtos.java

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

Compilation error of simple java files with Google Protocol Buffer

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

EDIT:

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

the second error:

The method writeTo(CodedOutputStream) from 开发者_StackOverflow社区the type AddressBookProtos.AddressBook refers to the missing type CodedOutputStream

These are from the AddPerson.java

AddressBookProtos.java has 100's of errors


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消