Unidata / thredds

THREDDS Data Server v4.6
https://www.unidata.ucar.edu/software/tds/v4.6/index.html
266 stars 179 forks source link

protobuf library is too old #872

Closed Yaqiang closed 7 years ago

Yaqiang commented 7 years ago

I don't know the version of Google protobuf library used in thredds, but it should be old that the readStringRequireUtf8() method is not included in CodedInputStream class. Is it possible to update the protobuf to neweast version?

For the temporary solution, is it possible to use an extra new version protobuf jar file to replace the protobuf in netCDF java library as runtime one?

cwardgar commented 7 years ago

Hi Yaqiang,

On version 5.0.0 of THREDDS, we are using a recent version of protobuf. I can confirm that it includes CodedInputStream.readStringRequireUtf8(). You should develop against 5.0.0.

Yaqiang commented 7 years ago

Thank cwardgar!

I tried version 5.0.0, but could not build it. So I am using the code in Main branch and change the protobuf version to libraries["protobuf-java"] = "com.google.protobuf:protobuf-java:3.0.2" in dependencies.gradle file. It was build successfully and sloved my problem. Thanks for you suggestion!

Yaqiang

lesserwhirls commented 7 years ago

Greetings @Yaqiang - could you tell us a bit about what was going wrong when you were trying to build the 5.0.0 branch? Thanks!

Yaqiang commented 7 years ago

I use "gradlew.bat build" command in dos environment, and return following error message:

FAILURE: Build failed with an exception.

BUILD FAILED

cwardgar commented 7 years ago

Sounds like you're using JDK7. THREDDS v5.0.0 requires JDK8. What is the output of:

java -version
Yaqiang commented 7 years ago

C:\Users\wyq>java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

cwardgar commented 7 years ago

Weird. Maybe you have multiple versions of Java installed, or something. Reference

Yaqiang commented 7 years ago

Yes, I installed both Java 7 and 8, and the JAVA_HOME is java jdk 7. But my program MeteoInfo was build with Java 7, so the thredds library with Java 8 may not suitable for me.

java_home