Closed Yaqiang closed 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.
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
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!
I use "gradlew.bat build" command in dos environment, and return following error message:
FAILURE: Build failed with an exception.
Where: Script 'D:\OpenSourceCode\Java\thredds_5.0\gradle\root\sonarqube.gradle' line: 7
What went wrong: A problem occurred evaluating script.
java.lang.UnsupportedClassVersionError: org/sonarqube/gradle/SonarQubePlugin : Unsupported major.minor version 52.0
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Sounds like you're using JDK7. THREDDS v5.0.0 requires JDK8. What is the output of:
java -version
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)
Weird. Maybe you have multiple versions of Java installed, or something. Reference
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.
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?