ProtoC输出什么Java版本? - 原始生成的Java输出不会编译
我正在尝试使用Google定义为.proto文件的GTF https:// https://developers.google.com/static/transit/ gtfs-realtime/gtfs-realtime.proto
我下载此文件并使用Protoc(libprotoc 3.17.3
)进行编译,该文件创建gftsrealtime.java
文件。但是,当我尝试编译此内容时,我会遇到以下错误:
GtfsRealtime.java:2537: error: cannot find symbol
UnusedPrivateParameter unused) {
^
...
GtfsRealtime.java:20170: error: method does not override or implement a method from a supertype
@java.lang.Override
^
这是我(MacOS)机器上的Java -version
:
> java --version
java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
我觉得问题是Protoc正在生成Java源代码的不同版本与我正在运行的不同,但我无法弄清protoc
生成的Java版本?
I am trying to use the GTFS defined as a .proto file by Google here
https://developers.google.com/static/transit/gtfs-realtime/gtfs-realtime.proto
I download this file and compile it using protoc (libprotoc 3.17.3
) which creates a GftsRealtime.java
file. But when I try to compile this, I'm getting errors such as the following:
GtfsRealtime.java:2537: error: cannot find symbol
UnusedPrivateParameter unused) {
^
...
GtfsRealtime.java:20170: error: method does not override or implement a method from a supertype
@java.lang.Override
^
Here is the java --version
on my (MacOS) machine:
> java --version
java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
I feel like the the issue is that protoc is generating a different version of Java source code than I am running but I can't figure out what Java version is generated by protoc
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论