NoSuchMethod error getting a gdata service

前端 未结 8 841
时光说笑
时光说笑 2020-12-09 14:06

I get the following error:

Exception in thread \"main\" java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.of([Ljava/lang/Object;)Lcom/googl         


        
相关标签:
8条回答
  • 2020-12-09 15:00

    I dont know if its still relevant but i had the same exception

    there is a problem with guava 11.02.jar (currently latest version)

    when using guava-10.0.1 (can be found here) everything went well.

    0 讨论(0)
  • 2020-12-09 15:02

    If you're using a build tool, such as Maven, then you could simply do something similar to the following example from a portion of the dependencies section in my pom.xml:

    <!-- The mail dependency is required BEFORE the javaee-api dependency.
             The gdata dependency (YouTube API) requires the mail dependency. -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gdata</groupId>
            <artifactId>core</artifactId>
            <version>1.47.1</version>
        </dependency>
    
    0 讨论(0)
提交回复
热议问题