Ahead Of Time (AOT) compilation build tools such as those provided by GraalVM's native-image
can require some configuration when using protobuf.
Protobuf for the JVM uses reflection and some of its target classes are not possible to determine in advance.
Historically, there were good reasons to use reflection based on APIs that were published effectively requiring them, and this situation is unlikely to change.
The Lite version of protobuf for the JVM avoids reflection and may be better suited for use with AOT compilation tooling. This Lite version was originally targeted for use on Android which has similar AOT compilation goals as GraalVM's native-image tool.
This section addresses GraalVM's native-image
configuration specifically as this AOT compilation tool due to its popularity. The native-image
tool can be configured
with respect to: the Java Native Interface (JNI), http proxying, reflection, and other resources. While these
considerations can be manually declared as JSON files, we recommend that a JVM application is exercised along with
the assisted configuration agent. The agent
will generate files that you can then subsequently point at when invoking native-image
. We recommend that the generated files are retained with a project's source
code.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。