2
votes

I'm experiencing issues compiling the latest Java YouTube API samples. After downloading (cloning) the git YouTube api-samplesrepo (https://github.com/youtube/api-samples), I followed the README instructions and typed "mvn compile". I received a bunch of errors. It seems like the POM file is trying to use older Google API client libs but not sure of the exact cause.

A few of the errors I receive are:

Captions.java:[27,46] error: cannot find symbol [ERROR]  class YouTube

and

Captions.java:[31,44] error: cannot find symbol [ERROR]  package com.google.api.services.youtube.model

and

Captions.java:[252,38] error: cannot find symbol [ERROR]  variable youtube of type YouTube

Anyone experiencing similar errors - all I'm doing is following the instructions in the README (https://github.com/youtube/api-samples/blob/master/java/README).

Thanks

-Ron

2
I have faced the same issue and no progress yet - Wasif Kirmani
@WasifKirmani, please, have a look at: stackoverflow.com/questions/35241129/… - Mike

2 Answers

1
votes

I tested with this same source and it got worked. First I installed maven (mvn) from https://maven.apache.org/guides/getting-started/windows-prerequisites.html

after this from path xxxxxxx\api-samples-master\java>mvn compile

It downloaded some links related to dependent files all accepted. and then run using: mvn exec:java -Dexec.mainClass= Example for running ListStreams test app:

mvn exec:java -Dexec.mainClass=com.google.api.services.samples.youtube.cmdline.live.ListStreams

It simply worked. Hope this helps you.

0
votes

Not sure how much this will help but while setting up my youtube API I changed the "project.youtube.version:" so that it ended like "project.youtube.version: v3-rev174-1.22.0". If you're planning on using either the CommentHandling or CommentThreads classes then you'll need to take the "V3" from the front of the two of their used imports.

Hope this helps.