Java - Rome rss reader?

点点圈 提交于 2019-12-05 00:13:13

问题


I am trying to read rss. I copied the jar file in to my libs folder, and I added the jar file to my eclipse project as a library. In order and export i checked my jar file.

Now I am trying to use the rss reader provided by rome

import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;

URL url  = new URL("http://myUrlGoesHere");
XmlReader reader = new XmlReader(url);      
SyndFeed feed = new SyndFeedInput().build(reader);

I get the following error on the last line: The type org.jdom.Document cannot be resolved. It is indirectly referenced from required .class file

What does this mean? What is the solution? * no error on imports *


回答1:


In addition to copying Rome's jar file to your libs folder, you also need to add JDOM's library (jar) to your class path.

The error you are getting says that someone is indirectly referencing JDOM's jar. Probably someone on Rome or any other library you don't control.




回答2:


In order to get it to compile I had to use the jdom-1.1.3.jar file from http://www.jdom.org/dist/binary/archive/. After the zip file is extracted it can be found in the directory jdom-1.1.3\jdom\build.

You will need to right click on your project| Select Properties | Java Build Path | Libraries | Add External JARs.



来源:https://stackoverflow.com/questions/5285807/java-rome-rss-reader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!