Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Including JAR files in Eclipse 4.2, specifically Rome (RSS Feed parser)

Reply
Thread Tools

Including JAR files in Eclipse 4.2, specifically Rome (RSS Feed parser)

 
 
galois271@gmail.com
Guest
Posts: n/a
 
      04-30-2013
Hi all,

I am new to putting third party files/libraries/JARS whatever you want to call them into my projects using Eclipse. I, specifically, want to include Rome, the RSS Feed parser, into my Java project in Eclipse. Rome depends on JDOM.

Can anyone tell me how to do this? I tried installing "External JARS", but I keep getting this in Eclipse:

"The type org.jdom.Document cannot be resolved. It is indirectly referenced from required .class files"

Here is my code:

import java.net.*;
import java.io.*;
import java.util.Iterator;

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;

public class EclipseTest
{

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException
{
URL url = new URL("http://viralpatel.net/blogs/feed");
XmlReader reader = null;

try {

reader = new XmlReader(url);
Error-> SyndFeed feed = new SyndFeedInput().build(reader);
System.out.println("Feed Title: "+ feed.getAuthor());

for (@SuppressWarnings("rawtypes")
Iterator i = feed.getEntries().iterator(); i.hasNext()
{
SyndEntry entry = (SyndEntry) i.next();
System.out.println(entry.getTitle());
}
}
finally
{
if (reader != null)
reader.close();

}
}

}


Thanks a ton!
 
Reply With Quote
 
 
 
 
galois271@gmail.com
Guest
Posts: n/a
 
      04-30-2013

> > "The type org.jdom.Document cannot be resolved. It is indirectly referenced from required .class files"


> Sounds like you're missing a jar file
>
> the distribution site for your third party lib should list all required
>
> dependencies.


> You could try refreshing your project
>
> also check out the .classpath xml file in your project root
>
> I've had to manually tweek this in the past to get things working.
>
>
>
> lipska
>
>
>
> --
>
> Lipska the Kat©: Troll hunter, sandbox destroyer
>
> and farscape dreamer of Aeryn Sun


I have put all the JDOM and ROME files into the project and refreshed, but I am still getting the above error. I don't know anything about the .classpath xml file. ??

Thanks, though!
 
Reply With Quote
 
 
 
 
Jeff Higgins
Guest
Posts: n/a
 
      04-30-2013
On 04/29/2013 11:25 PM, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
> "The type org.jdom.Document cannot be resolved. It is indirectly referenced from required .class files"
>

I've pasted you’re error message verbatim into my browser search box.
There seems to be about four common problems.
Jdom version, Jdom distribution packaging, seem to be the most common.
 
Reply With Quote
 
galois271@gmail.com
Guest
Posts: n/a
 
      04-30-2013
> So, I downloaded jdom-1.1.3, added this to the build path and removed
>
> jdom-2.0.5, after changing throws IOException to throws Exception the
>
> project built with no errors.
>
>
>
> Try adding jdom-1.1.3 and removing jdom-2.0.5 ... works for me.
>
>
>
> lipska
>
>
>
> --
>
> Lipska the Kat�: Troll hunter, sandbox destroyer
>
> and farscape dreamer of Aeryn Sun


Thanks guys! I did like 10 searches with the error and saw nothing but sites about JDOM & Rome capabilities. ??

 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      04-30-2013
Chuck Johnson wrote:
> > So, I downloaded jdom-1.1.3, added this to the build path and removed
> > jdom-2.0.5, after changing throws IOException to throws Exception the


It is better to catch the specific 'Exception', and worth the effort to find out which
one that is.

>> project built with no errors.


What about warnings?

How rigorous are your warning settings?

I recommend resolving the dependencies at the command line, using Ant, first.
Then work through the project "Build Path" in Eclipse to ensure that it matches.

Without a doubt you are missing a piece therein. Since your posts lack specifics it
is very difficult to be specific in turn.

Eclipse should not be your primary build environment.

--
Lew
 
Reply With Quote
 
Chuck Johnson
Guest
Posts: n/a
 
      04-30-2013
On Tuesday, April 30, 2013 2:53:34 PM UTC-5, lipska the kat wrote:
> On 30/04/13 20:30, Lew wrote:
>
> > Chuck Johnson wrote:

>
> >>> So, I downloaded jdom-1.1.3, added this to the build path and removed

>
> >>> jdom-2.0.5, after changing throws IOException to throws Exception the

>
> >

>
> > It is better to catch the specific 'Exception', and worth the effort to find out which

>
> > one that is.


Hmm...? I didn't write anything after the thanks post, so I don't know how this comment about throwing exceptions got up here. It wasn't me. ??
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      05-01-2013
On 4/30/2013 3:53 PM, lipska the kat wrote:
> On 30/04/13 20:30, Lew wrote:
>> Chuck Johnson wrote:
>>>> So, I downloaded jdom-1.1.3, added this to the build path and removed
>>>> jdom-2.0.5, after changing throws IOException to throws Exception the

>>
>> It is better to catch the specific 'Exception', and worth the effort
>> to find out which
>> one that is.

>
> Are you sure you know who you are replying to Bloch local?


No reason to think he don't.

>>>> project built with no errors.

>>
>> What about warnings?
>>
>> How rigorous are your warning settings?

>
> None of your bloody business
>
>> I recommend resolving the dependencies at the command line, using Ant,
>> first.
>> Then work through the project "Build Path" in Eclipse to ensure that
>> it matches.
>>
>> Without a doubt you are missing a piece therein. Since your posts lack
>> specifics it
>> is very difficult to be specific in turn.

>
> The OP has it working now Bloch so why don't save your breath.


That something is working does not mean that good advice can
not be given.

>> Eclipse should not be your primary build environment.

>
> What the hell are you saying now you idiot.
> I can only assume you think you are responding to the OP.
>
> You don't use Ant to build a simple single class that only exists to
> test your path do you? why are you spreading this mis-information, why
> do you have to over-complicate everything? KISS.
>
> You can build with Ant in Eclipse, I've built huge systems with Ant in
> Eclipse, Eclipse is a great build tool it's my primary build
> environment. Don't listen to Bloch local OP, Eclipse is a great build
> tool, loads of professional developers I know use Eclipse as their
> primary build environment.
>
> Stop spreading mis-information.


It is very bad practice to use the IDE as primary build environment
(at least if we assume that primary means the official builds).

The risk of stuff not checked into source control being included
in the build and build options being development oriented instead
of production oriented is way too big.

But if the original code posted is just a SSCCE to illustrate
the problem, then I can not see a problem in this specific case
either.

> ... And who's this Chuck Johnson geezer


OP

Arne


 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      05-01-2013
On 05/01/2013 01:55 AM, lipska the kat wrote:
>
> The OP had a problem with Eclipse, as it turns out it was actually a
> problem with incompatible third party components. 'Helping' the OP by
> telling him not to use Eclipse to build his project wasn't really
> answering the question was it.
>

As it turns out Chuck has begun his Java education at a horrendous
starting place.


 
Reply With Quote
 
Joerg Meier
Guest
Posts: n/a
 
      05-01-2013
On Wed, 01 May 2013 03:22:19 -0400, Jeff Higgins wrote:

> On 05/01/2013 01:55 AM, lipska the kat wrote:
>> The OP had a problem with Eclipse, as it turns out it was actually a
>> problem with incompatible third party components. 'Helping' the OP by
>> telling him not to use Eclipse to build his project wasn't really
>> answering the question was it.

> As it turns out Chuck has begun his Java education at a horrendous
> starting place.


I wish those two would just put each other in their respective softwares
filter and stop polluting every second thread with their name calling and
personal attacks. I find both of them usually make good and worthwhile
posts, so I wouldn't want to filter them myself, it's just that when they
reply to each other that it becomes more noise than signal

Liebe Gruesse,
Joerg

--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      05-02-2013
On 5/1/2013 1:55 AM, lipska the kat wrote:
> On 01/05/13 02:26, Arne Vajhøj wrote:
>> On 4/30/2013 3:53 PM, lipska the kat wrote:
>>> On 30/04/13 20:30, Lew wrote:
>>>> Chuck Johnson wrote:
>>>>>> So, I downloaded jdom-1.1.3, added this to the build path and removed
>>>>>> jdom-2.0.5, after changing throws IOException to throws Exception the
>>>>
>>>> It is better to catch the specific 'Exception', and worth the effort
>>>> to find out which
>>>> one that is.
>>>
>>> Are you sure you know who you are replying to Bloch local?

>>
>> No reason to think he don't.
>>
>>>>>> project built with no errors.
>>>>
>>>> What about warnings?
>>>>
>>>> How rigorous are your warning settings?
>>>
>>> None of your bloody business
>>>
>>>> I recommend resolving the dependencies at the command line, using Ant,
>>>> first.
>>>> Then work through the project "Build Path" in Eclipse to ensure that
>>>> it matches.
>>>>
>>>> Without a doubt you are missing a piece therein. Since your posts lack
>>>> specifics it
>>>> is very difficult to be specific in turn.
>>>
>>> The OP has it working now Bloch so why don't save your breath.

>>
>> That something is working does not mean that good advice can
>> not be given.
>>
>>>> Eclipse should not be your primary build environment.
>>>
>>> What the hell are you saying now you idiot.
>>> I can only assume you think you are responding to the OP.
>>>
>>> You don't use Ant to build a simple single class that only exists to
>>> test your path do you? why are you spreading this mis-information, why
>>> do you have to over-complicate everything? KISS.
>>>
>>> You can build with Ant in Eclipse, I've built huge systems with Ant in
>>> Eclipse, Eclipse is a great build tool it's my primary build
>>> environment. Don't listen to Bloch local OP, Eclipse is a great build
>>> tool, loads of professional developers I know use Eclipse as their
>>> primary build environment.
>>>
>>> Stop spreading mis-information.

>>
>> It is very bad practice to use the IDE as primary build environment
>> (at least if we assume that primary means the official builds)

>
> The OP had a problem with Eclipse, as it turns out it was actually a
> problem with incompatible third party components. 'Helping' the OP by
> telling him not to use Eclipse to build his project wasn't really
> answering the question was it.


Correct.

But the question of IDE build came up in the thread.

And that is a bad practice for real builds.

Arne


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nokia + Eclipse: creating JAR files from eclipse John Goche Java 2 01-22-2006 01:53 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
getting eclipse to recognize endorsed library over-rides (specifically, want it to pick up later versions of xalan) _clb_ Chris Bedford Java 1 10-06-2003 05:03 PM



Advertisments