热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Unresolveddependenciesintheprotocolbufferjavasourcecode

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 个解决方案

#1


3  

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

您需要生成和构建与protobuf描述符对应的Java代码。

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

在java目录的README.txt文件底部附近有这方面的说明。


推荐阅读
author-avatar
chen-yu2502881617
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有