NoSuchMethod error getting a gdata service

前端 未结 8 849
时光说笑
时光说笑 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 14:45

    The Required library jars are as follows.

    gdata-client-1.0.jar
    gdata-core-1.0.jar
    gdata-media-1.0.jar
    gdata-youtube-2.0.jar
    guava-11.0.2.jar
    java-mail-1.4.4.jar
    

    I am using the above mentioned library . Please make use of it ; because the ultimate aim is to get the YouTubeService Object. Check below for the code snippet.

    package com.baba.test;
    /*
    * Author : Somanath Nanda
    */
    
    
    import java.net.MalformedURLException;
    import java.net.URL;
    import com.google.gdata.client.youtube.YouTubeQuery;
    import com.google.gdata.client.youtube.YouTubeService;
    public class Test {
    private static final String CLIENT_ID = "XXXXXXXX.XXXXX.XXX.XXX";
    private static final String DEVELOPER_KEY = "*********************************88";
    public static void main(String[] args) throws MalformedURLException {
    YouTubeService service = new YouTubeService(CLIENT_ID,DEVELOPER_KEY);
    System.out.println("Service : "+service);
    }
    

提交回复
热议问题