Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用OpenJDK提供的jre无法进行编译,Oracle的jre的确可以 #42

Closed
yourwafer opened this issue Mar 29, 2016 · 5 comments
Closed

Comments

@yourwafer
Copy link

为什么需要在运行使用JdkCompiler,而不直接使用javassist等字节码方式

@xiemalin
Copy link
Contributor

javassist不支持泛型,这样会对上面的已提供的接口造成影响。如果其它jdk使用,可以考虑jprotobuf-android这个模块 http://repo1.maven.org/maven2/com/baidu/jprotobuf-android/

@yourwafer
Copy link
Author

你们使用的是ProtobufIDLProxy.createCodeByType分析传输对象,拼出源代码的方式,生成代理类,而我的意思是分析传输对象后,直接通过javassist生成代理类,这和支不支持泛型没关系吧。
因为我们的服务器可能会装openjdk,所以才碰到这个问题

@xiemalin
Copy link
Contributor

目前主要是Codec接口合适了泛型,这个已经被很多项目广泛使用了。能否告之一下你们目前具体使用的场景是什么? 如果只是定义pojo对象,然后生成protobuf序列化或反序化,这个你们直接使用jprotobuf-android这个模块即可,他支持跨jdk的

@yourwafer yourwafer reopened this Mar 30, 2016
@yourwafer
Copy link
Author

请教你一下,v3目录是支持protobuf 3的对吧,但我使用2.6.1版本的转换工具,却转换不了proto 中文件,会提示解析不了syntax = "proto3",你那边怎么做到的

@xiemalin
Copy link
Contributor

不需要加 syntax = "proto3"这一句

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants