今天遇到了“Unable to install breakpoint due to missing line numberattribute. Modify compiler options to generate line numberattributes”问题。 检查Preferences -> Java -> Perference,“Add linenumber attributes to generated class files (used by thedebugger)“已经勾选了。 应该是SpringAOP产生的代码没有行数信息,但是我自己写的代码还是带行数信息的,因此虽然会弹出这些烦人的警告,所设断点还是其作用的。让它不再提示即可。
Google Credential设置见我之前的博文解决 “Access Not Configured. The API (YouTube Analytics API) is not enabled for your project.”。
示例代码:
package com.yqu.yt; import java.io.IOException; import java.io.PrintStream; import java.math.BigDecimal; import java.util.List; import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.json.JsonFactory; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.services.youtube.YouTube; import com.google.api.services.youtube.model.Channel; import com.google.api.services.youtube.model.ChannelListResponse; import com.google.api.services.youtubeAnalytics.YouTubeAnalytics; import com.google.api.services.youtubeAnalytics.model.ResultTable; import com.google.api.services.youtubeAnalytics.model.ResultTable.ColumnHeaders; import com.google.common.collect.Lists; public class HelloYoutubeAnalytics { //I18NOK:CLS private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); private static final JsonFactory JSON_FACTORY = new JacksonFactory(); private static YouTube youtube; private static YouTubeAnalytics analytics; public static void main(String[] args) { // These scopes are required to access information about the // authenticated user's YouTube channel as well as Analytics // data for that channel.