NoSuchMethodError exception when using com.google.common.base.Splitter

前端 未结 7 2030
一个人的身影
一个人的身影 2021-01-17 07:38

I\'m trying to use com.google.common.base.Splitter as follows

Iterable segs = Splitter.on(\"/\").split(\"one/two/three/four/five\");

for (Stri         


        
相关标签:
7条回答
  • 2021-01-17 08:37

    Another reason this happens is if the GSON library is imported before the Guava library.

    See: https://github.com/google/guava/issues/2786

    I was importing the jars from a folder into IntelliJ. What ended up working was add a "z" next to gson (so the jar would be named zgson) so that Guava would import first.

    0 讨论(0)
提交回复
热议问题