2020a protobuf version

34 views (last 30 days)
Matt
Matt on 1 Apr 2021
Commented: Matt on 3 Aug 2022
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 Comments
Bill Gruner
Bill Gruner on 2 Aug 2022
I just ran into the same issue. Any luck?
Matt
Matt on 3 Aug 2022
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).

Sign in to comment.

Answers (0)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!