作者:chen-yu2502881617 | 来源:互联网 | 2023-01-11 16:47
IamtryingtouseProtocolbuffersinmyproject(web-app)basedinJava.IdownloadedzipProtocol
I am trying to use Protocol buffers in my project(web-app) based in Java. I downloaded zip Protocol Buffers 2.4.0a full source(C++,Java,Python)
& Protocol Buffers 2.4.0 compiler-Windows binary
.
我试图在我的基于Java的项目(web-app)中使用协议缓冲区。我下载了zip Protocol Buffers 2.4.0a完整源代码(C ++,Java,Python)和Protocol Buffers 2.4.0编译器-Windows二进制文件。
I was able to build the .proto file and generate the required java classes for my project, using the protoc compiler. Then I included the java folder(protobuf-2.4.0a\java\src\main\java......) contained in the PB's downloaded zipped source code to my project's src
directory. However as I can see in my IDE, some of its dependencies of those files are not yet resolved. and I was not able to deserialize the messages when i tried out, (I guess I was able to serialize, however).
我能够使用protoc编译器构建.proto文件并为我的项目生成所需的java类。然后我将PB下载的压缩源代码中包含的java文件夹(protobuf-2.4.0a \ java \ src \ main \ java ......)包含到我项目的src目录中。但是正如我在IDE中看到的那样,这些文件的某些依赖关系尚未解决。当我尝试时,我无法反序列化消息,(我想我能够序列化)。
Could you help me by letting me know what needs to be fixed ? Shouldnt I be instead putting a jar in my classpath rather than including the PB source code to my src folder?
让我知道需要修复什么,能帮到我吗?我不应该在我的类路径中放一个jar而不是将PB源代码包含到我的src文件夹中吗?
(I didnt used maven anywhere to download anything. I do not know how to use maven)
(我没有在任何地方使用maven下载任何东西。我不知道如何使用maven)
1 个解决方案