【发布时间】:2015-12-10 10:04:18
【问题描述】:
使用 Eclipse Luna 我正在尝试运行导入已弃用的 google-collections 的 java 代码,该代码在使用最新 Guava 版本编译时会引发异常。
public static void run(String consumerKey, String consumerSecret, String token, String secret) throws InterruptedException
{
BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);
StatusesFilterEndpoint endpoint = new StatusesFilterEndpoint();
endpoint.trackTerms(Lists.newArrayList("twitterapi", "#AAPSweep"));
Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret);
Client client = new ClientBuilder()
.hosts(Constants.STREAM_HOST)
.endpoint(endpoint)
.authentication(auth)
.processor(new StringDelimitedProcessor(queue))
.build();
client.connect();
我试图从插件中删除 com.google.guava_15.0.0.v201403281430 文件,并尝试按照here in a comment 的说明粘贴 Guava 旧版本,但我无法安装(指向)旧 guava 版本。 这个问题可能还有另一种解决方案here,但我是 java 新手,不知道如何用其他列表替换该列表。
请问有没有人可以使用其他 List 方法运行该代码? 要么 告诉我如何在 Eclipse 中添加旧版本的番石榴(我不确定这会解决这个问题,只是从一个线程中读取它) 要么 告诉我其他解决方案。谢谢
【问题讨论】:
标签: java twitter arraylist guava twitter-hbc