remrick
remrick

Reputation: 279

YouTube API Java Samples Do Not Complile

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

Upvotes: 2

Views: 302

Answers (2)

Abdul
Abdul

Reputation: 18

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.

Upvotes: 1

William Clifford
William Clifford

Reputation: 1

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.

Upvotes: 0

Related Questions