2020a protobuf version

31 次查看(过去 30 天)
Matt
Matt 2021-4-1
评论: Matt 2022-8-3
A few years ago I wrote some hybrid Java/Matlab code to handle reading/writing Google protobuf messages. Initially I built this on protobuf version 3.5.0. More recently I updated this code to use protobuf version 3.7.1. This code no longer works after updating to Matlab 2020a when using the .jar's I compiled with protobuf 3.7.1; it still works with the .jar's using 3.5.0. I came across a forum here that leads me to believe the issue is that Matlab is now shipping with "built in" protobuf jars (R2020A\java\jarext\protobuf3.jar), which it adds to its static Java path, but conflict with certain newer protobuf features. Because it is on the static path I can't dynamically give my jars "preference" via javaaddpath. The only work-around I can think of is via a javaclasspath file to update the static path, but this is not a reasonable option as the code is used by multiple users on different machines via a network license. Is there anything I can do about this? It's been quite a while, but I believe I moved from protobuf version 3.5.0 up to 3.7.1 because the older one can conflict with some features in newer Java versions, so it's unstable in more recent versions of Matlab. Which protobuf versions are supported by the protobuf3.jar included with R2020a? If it supports protobuf 3.6.x I can try compiling my code again using that version, assuming it is supported by newer Java versions. Thanks!
  2 个评论
Bill Gruner
Bill Gruner 2022-8-2
I just ran into the same issue. Any luck?
Matt
Matt 2022-8-3
No, and I just submitted an updated bug report last week. If you don't mind messing with your installation files, you can delete or move (so you can move it back) the protobuf3.jar I mentioned in the question. You can also adjust your static Java path, but I can't remember how to do that. There may be other .jar's you have to deal with as well (I had to also deal with gson.jar in R2022a).

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Java from MATLAB 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by