Unresolved Dependencies in Java Protocol Buffer Source Code

I am trying to use protocol buffers in my Java based project (web application). I downloaded zip Protocol Buffers 2.4.0a full source(C++,Java,Python) and Protocol Buffers 2.4.0 compiler-Windows binary .

I managed to create a .proto file and generate the necessary java classes for my project using the protoc compiler. Then I included the java folder (protobuf-2.4.0a \ java \ src \ main \ java ......) in the downloaded compressed PB source code in the src project directory. However, as I see in my IDE, some of its dependencies on these files have not yet been resolved. and I was not able to deserialize the messages when I tried (I think I was able to serialize, however).

Could you help me by letting me know what needs to be fixed? Should I instead add jar to my classpath, and not include the PB source code in my src folder?

(I didn’t use maven to download anything. I don’t know how to use maven)

+4
source share
1 answer

You need to generate and build the Java code corresponding to protobuf descriptors.

There are instructions for this at the bottom of the README.txt file in the java directory .

+3
source

Source: https://habr.com/ru/post/1343014/


All Articles