title: Youtube Data API Project in a JAR File
body: <p>I built a java program that is based on the Youtube Data API command line Examples. The program works fine and I now tried to convert the java class into a JAR file in order for me not having to start eclipse each time I want to use the program. To build the jar file I used the Eclipse export function "File->Export->Java->runnable JAR file". 
  I also chose to extract all required Libraries into the generated JAR.</p>
  
  <p>All seems to work fine up to the point where I execute the program, which even creates the output file I wanted it to create but the JAR file doesn't seem to be able to retrieve data from the Youtube Data API, which means the created file is empty.</p>
  
  <p>Is there anyone who can help me or at least is experiencing silimar issues?</p>
  
  <p>Below I attached two sample Outputs:</p>
  
  <p>This is what I get when executing the code within eclipse which gives me the correct answer</p>
  
  <pre>Channel; Subscribercount<br>
  Channelname; 12345</pre>
  
  <p>This is what I get when executing the JAR file</p>
  
  <pre>Channel; Subscribercount<br>
  Channelname; null</pre>
  
  <p>It seems that the JAR fails to connect to the API</p>
  
  <p>Here I have a console log: 
  None of these errors occur when executing within eclipse</p>
  
  <pre><code>java.lang.NullPointerException
          at java.io.Reader.&lt;init&gt;(Reader.java:78)
          at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:72)
          at com.google.api.services.samples.youtube.cmdline.Auth.authorize(Auth.java:51)
          at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.retrieveChannelInfo(getChannelsVideos.java:220)
          at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.main(getChannelsVideos.java:49)
  java.lang.NullPointerException
          at java.io.Reader.&lt;init&gt;(Reader.java:78)
          at java.io.InputStreamReader.&lt;init&gt;(InputStreamReader.java:72)
          at com.google.api.services.samples.youtube.cmdline.Auth.authorize(Auth.java:51)
          at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.getChannelsVideo(getChannelsVideos.java:92)
          at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.main(getChannelsVideos.java:50)
  </code></pre>