You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Jonathan Hunter <Jo...@oberlin.edu> on 2007/01/10 07:24:31 UTC

Running Nutch in Eclipse

nutch users,
I am having problems making modifications to the PruneIndexTool using
Eclipse from the nutch-0.8.1 release. I am able to import files into
Eclipse, thanks to this tutorial:
http://wiki.apache.org/nutch/RunNutchInEclipse
What I have run into is that Eclipse does not recognize the inheritance
from the other nutch classes. When a class is called to define a
variable, i get an error message: "*class* cannot be resolved to a
type". Some of this may stem from the inability to import packages: "The
import org.apache.lucene cannot be resolved"//one example//

More specifically, all classes have this sort of problem:
public boolean isPrunable(Query q, IndexReader reader, int docNum)
throws Exception{
            Document doc = reader.document(docNum);
            String url = doc.get("url");
//Error: Query cannot be resolved to a type
//Error: IndexReader cannot be resolved to a type
//Error: Document cannot be resolved to a type

Eclipse Properties:
I have followed the tutorial and have a build path with the conf/
directory. Under the java build path I have included as sources all the
files in the nutch directory. Each pull down tab has:
Included: (all)
Excluded: (none)
Native library location: (none)
Under Projects tab in the build path I do not have anything when I try
to add a project there are no projects to add.
Libraries include the two .jar files added from the tutoiral:
http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-mp3/lib/
http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-rtf/lib/
and the system library.
The Order and Export tab has all the nutch folders with its plugins.

If you could direct me to be to be able to resolve these variables and
allow Eclipse to inherit each class in the nutch directory, it would be
much appreciated.

~Jon

Re: Running Nutch in Eclipse

Posted by Jonathan Hunter <Jo...@oberlin.edu>.
I was able to add you suggested .jar files and thankfully decreased the
number of errors from 5000 to 33. I think I'm still missing a couple
that I'm not aware of.

thank you,
~Jon

----- Original Message -----
From: chee wu <ch...@gmail.com>
Date: Wednesday, January 10, 2007 8:58 pm
Subject: Re: Running Nutch in Eclipse
To: nutch-user@lucene.apache.org

> Required  lib  were not added to eclipse,try to add all the jar 
> files in "<NUTCH_HOME>/lib" directory.
> You can also refer the "bin/nutch" script for the jar file list 
> required by nutch..
> 
> ----- Original Message ----- 
> From: "Jonathan Hunter" <Jo...@oberlin.edu>
> To: <nu...@lucene.apache.org>
> Sent: Thursday, January 11, 2007 1:04 AM
> Subject: Re: Running Nutch in Eclipse
> 
> 
> >I hope this will be helpful
> > ~Jon
> > 
> > ----- Original Message -----
> > From: chee wu <ch...@gmail.com>
> > Date: Wednesday, January 10, 2007 4:40 am
> > Subject: Re: Running Nutch in Eclipse
> > To: nutch-user@lucene.apache.org
> > 
> >> Send  us your classpath configure file  ".class"  of your 
> Eclipse 
> >> project ....
> >> 
> >> ----- Original Message ----- 
> >> From: "Jonathan Hunter" <Jo...@oberlin.edu>
> >> To: <nu...@lucene.apache.org>
> >> Sent: Wednesday, January 10, 2007 2:24 PM
> >> Subject: Running Nutch in Eclipse
> >> 
> >> 
> >> > nutch users,
> >> > I am having problems making modifications to the 
> PruneIndexTool 
> >> using> Eclipse from the nutch-0.8.1 release. I am able to import 
> >> files into
> >> > Eclipse, thanks to this tutorial:
> >> > http://wiki.apache.org/nutch/RunNutchInEclipse
> >> > What I have run into is that Eclipse does not recognize the 
> >> inheritance> from the other nutch classes. When a class is 
> called 
> >> to define a
> >> > variable, i get an error message: "*class* cannot be resolved 
> to a
> >> > type". Some of this may stem from the inability to import 
> >> packages: "The
> >> > import org.apache.lucene cannot be resolved"//one example//
> >> > 
> >> > More specifically, all classes have this sort of problem:
> >> > public boolean isPrunable(Query q, IndexReader reader, int 
> docNum)>> > throws Exception{
> >> >            Document doc = reader.document(docNum);
> >> >            String url = doc.get("url");
> >> > //Error: Query cannot be resolved to a type
> >> > //Error: IndexReader cannot be resolved to a type
> >> > //Error: Document cannot be resolved to a type
> >> > 
> >> > Eclipse Properties:
> >> > I have followed the tutorial and have a build path with the conf/
> >> > directory. Under the java build path I have included as 
> sources 
> >> all the
> >> > files in the nutch directory. Each pull down tab has:
> >> > Included: (all)
> >> > Excluded: (none)
> >> > Native library location: (none)
> >> > Under Projects tab in the build path I do not have anything 
> when 
> >> I try
> >> > to add a project there are no projects to add.
> >> > Libraries include the two .jar files added from the tutoiral:
> >> > http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-
> >> mp3/lib/> 
> >> http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-
> rtf/lib/>> > and the system library.
> >> > The Order and Export tab has all the nutch folders with its 
> plugins.>> > 
> >> > If you could direct me to be to be able to resolve these 
> >> variables and
> >> > allow Eclipse to inherit each class in the nutch directory, it 
> >> would be
> >> > much appreciated.
> >> > 
> >> > ~Jon
> >> >
> >

Re: Running Nutch in Eclipse

Posted by Jonathan Hunter <Jo...@oberlin.edu>.
thanks for your help I was able to run nutch in eclipse. I included the
lib/, plugin/ and conf/ directories in the class path, as well as the
default eclipse plugins. I also made sure the only source folder was the
where I was saving the project. 

thanks again,
~Jon

----- Original Message -----
From: chee wu <ch...@gmail.com>
Date: Wednesday, January 10, 2007 8:58 pm
Subject: Re: Running Nutch in Eclipse
To: nutch-user@lucene.apache.org

> Required  lib  were not added to eclipse,try to add all the jar 
> files in "<NUTCH_HOME>/lib" directory.
> You can also refer the "bin/nutch" script for the jar file list 
> required by nutch..
> 
> ----- Original Message ----- 
> From: "Jonathan Hunter" <Jo...@oberlin.edu>
> To: <nu...@lucene.apache.org>
> Sent: Thursday, January 11, 2007 1:04 AM
> Subject: Re: Running Nutch in Eclipse
> 
> 
> >I hope this will be helpful
> > ~Jon
> > 
> > ----- Original Message -----
> > From: chee wu <ch...@gmail.com>
> > Date: Wednesday, January 10, 2007 4:40 am
> > Subject: Re: Running Nutch in Eclipse
> > To: nutch-user@lucene.apache.org
> > 
> >> Send  us your classpath configure file  ".class"  of your 
> Eclipse 
> >> project ....
> >> 
> >> ----- Original Message ----- 
> >> From: "Jonathan Hunter" <Jo...@oberlin.edu>
> >> To: <nu...@lucene.apache.org>
> >> Sent: Wednesday, January 10, 2007 2:24 PM
> >> Subject: Running Nutch in Eclipse
> >> 
> >> 
> >> > nutch users,
> >> > I am having problems making modifications to the 
> PruneIndexTool 
> >> using> Eclipse from the nutch-0.8.1 release. I am able to import 
> >> files into
> >> > Eclipse, thanks to this tutorial:
> >> > http://wiki.apache.org/nutch/RunNutchInEclipse
> >> > What I have run into is that Eclipse does not recognize the 
> >> inheritance> from the other nutch classes. When a class is 
> called 
> >> to define a
> >> > variable, i get an error message: "*class* cannot be resolved 
> to a
> >> > type". Some of this may stem from the inability to import 
> >> packages: "The
> >> > import org.apache.lucene cannot be resolved"//one example//
> >> > 
> >> > More specifically, all classes have this sort of problem:
> >> > public boolean isPrunable(Query q, IndexReader reader, int 
> docNum)>> > throws Exception{
> >> >            Document doc = reader.document(docNum);
> >> >            String url = doc.get("url");
> >> > //Error: Query cannot be resolved to a type
> >> > //Error: IndexReader cannot be resolved to a type
> >> > //Error: Document cannot be resolved to a type
> >> > 
> >> > Eclipse Properties:
> >> > I have followed the tutorial and have a build path with the conf/
> >> > directory. Under the java build path I have included as 
> sources 
> >> all the
> >> > files in the nutch directory. Each pull down tab has:
> >> > Included: (all)
> >> > Excluded: (none)
> >> > Native library location: (none)
> >> > Under Projects tab in the build path I do not have anything 
> when 
> >> I try
> >> > to add a project there are no projects to add.
> >> > Libraries include the two .jar files added from the tutoiral:
> >> > http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-
> >> mp3/lib/> 
> >> http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-
> rtf/lib/>> > and the system library.
> >> > The Order and Export tab has all the nutch folders with its 
> plugins.>> > 
> >> > If you could direct me to be to be able to resolve these 
> >> variables and
> >> > allow Eclipse to inherit each class in the nutch directory, it 
> >> would be
> >> > much appreciated.
> >> > 
> >> > ~Jon
> >> >
> >

Re: Running Nutch in Eclipse

Posted by chee wu <ch...@gmail.com>.
Required  lib  were not added to eclipse,try to add all the jar files in "<NUTCH_HOME>/lib" directory.
You can also refer the "bin/nutch" script for the jar file list required by nutch..

----- Original Message ----- 
From: "Jonathan Hunter" <Jo...@oberlin.edu>
To: <nu...@lucene.apache.org>
Sent: Thursday, January 11, 2007 1:04 AM
Subject: Re: Running Nutch in Eclipse


>I hope this will be helpful
> ~Jon
> 
> ----- Original Message -----
> From: chee wu <ch...@gmail.com>
> Date: Wednesday, January 10, 2007 4:40 am
> Subject: Re: Running Nutch in Eclipse
> To: nutch-user@lucene.apache.org
> 
>> Send  us your classpath configure file  ".class"  of your Eclipse 
>> project ....
>> 
>> ----- Original Message ----- 
>> From: "Jonathan Hunter" <Jo...@oberlin.edu>
>> To: <nu...@lucene.apache.org>
>> Sent: Wednesday, January 10, 2007 2:24 PM
>> Subject: Running Nutch in Eclipse
>> 
>> 
>> > nutch users,
>> > I am having problems making modifications to the PruneIndexTool 
>> using> Eclipse from the nutch-0.8.1 release. I am able to import 
>> files into
>> > Eclipse, thanks to this tutorial:
>> > http://wiki.apache.org/nutch/RunNutchInEclipse
>> > What I have run into is that Eclipse does not recognize the 
>> inheritance> from the other nutch classes. When a class is called 
>> to define a
>> > variable, i get an error message: "*class* cannot be resolved to a
>> > type". Some of this may stem from the inability to import 
>> packages: "The
>> > import org.apache.lucene cannot be resolved"//one example//
>> > 
>> > More specifically, all classes have this sort of problem:
>> > public boolean isPrunable(Query q, IndexReader reader, int docNum)
>> > throws Exception{
>> >            Document doc = reader.document(docNum);
>> >            String url = doc.get("url");
>> > //Error: Query cannot be resolved to a type
>> > //Error: IndexReader cannot be resolved to a type
>> > //Error: Document cannot be resolved to a type
>> > 
>> > Eclipse Properties:
>> > I have followed the tutorial and have a build path with the conf/
>> > directory. Under the java build path I have included as sources 
>> all the
>> > files in the nutch directory. Each pull down tab has:
>> > Included: (all)
>> > Excluded: (none)
>> > Native library location: (none)
>> > Under Projects tab in the build path I do not have anything when 
>> I try
>> > to add a project there are no projects to add.
>> > Libraries include the two .jar files added from the tutoiral:
>> > http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-
>> mp3/lib/> 
>> http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-rtf/lib/
>> > and the system library.
>> > The Order and Export tab has all the nutch folders with its plugins.
>> > 
>> > If you could direct me to be to be able to resolve these 
>> variables and
>> > allow Eclipse to inherit each class in the nutch directory, it 
>> would be
>> > much appreciated.
>> > 
>> > ~Jon
>> >
>

Re: Running Nutch in Eclipse

Posted by Jonathan Hunter <Jo...@oberlin.edu>.
I hope this will be helpful
~Jon

----- Original Message -----
From: chee wu <ch...@gmail.com>
Date: Wednesday, January 10, 2007 4:40 am
Subject: Re: Running Nutch in Eclipse
To: nutch-user@lucene.apache.org

> Send  us your classpath configure file  ".class"  of your Eclipse 
> project ....
> 
> ----- Original Message ----- 
> From: "Jonathan Hunter" <Jo...@oberlin.edu>
> To: <nu...@lucene.apache.org>
> Sent: Wednesday, January 10, 2007 2:24 PM
> Subject: Running Nutch in Eclipse
> 
> 
> > nutch users,
> > I am having problems making modifications to the PruneIndexTool 
> using> Eclipse from the nutch-0.8.1 release. I am able to import 
> files into
> > Eclipse, thanks to this tutorial:
> > http://wiki.apache.org/nutch/RunNutchInEclipse
> > What I have run into is that Eclipse does not recognize the 
> inheritance> from the other nutch classes. When a class is called 
> to define a
> > variable, i get an error message: "*class* cannot be resolved to a
> > type". Some of this may stem from the inability to import 
> packages: "The
> > import org.apache.lucene cannot be resolved"//one example//
> > 
> > More specifically, all classes have this sort of problem:
> > public boolean isPrunable(Query q, IndexReader reader, int docNum)
> > throws Exception{
> >            Document doc = reader.document(docNum);
> >            String url = doc.get("url");
> > //Error: Query cannot be resolved to a type
> > //Error: IndexReader cannot be resolved to a type
> > //Error: Document cannot be resolved to a type
> > 
> > Eclipse Properties:
> > I have followed the tutorial and have a build path with the conf/
> > directory. Under the java build path I have included as sources 
> all the
> > files in the nutch directory. Each pull down tab has:
> > Included: (all)
> > Excluded: (none)
> > Native library location: (none)
> > Under Projects tab in the build path I do not have anything when 
> I try
> > to add a project there are no projects to add.
> > Libraries include the two .jar files added from the tutoiral:
> > http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-
> mp3/lib/> 
> http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-rtf/lib/
> > and the system library.
> > The Order and Export tab has all the nutch folders with its plugins.
> > 
> > If you could direct me to be to be able to resolve these 
> variables and
> > allow Eclipse to inherit each class in the nutch directory, it 
> would be
> > much appreciated.
> > 
> > ~Jon
> >

Re: Running Nutch in Eclipse

Posted by chee wu <ch...@gmail.com>.
Send  us your classpath configure file  ".class"  of your Eclipse project ....

----- Original Message ----- 
From: "Jonathan Hunter" <Jo...@oberlin.edu>
To: <nu...@lucene.apache.org>
Sent: Wednesday, January 10, 2007 2:24 PM
Subject: Running Nutch in Eclipse


> nutch users,
> I am having problems making modifications to the PruneIndexTool using
> Eclipse from the nutch-0.8.1 release. I am able to import files into
> Eclipse, thanks to this tutorial:
> http://wiki.apache.org/nutch/RunNutchInEclipse
> What I have run into is that Eclipse does not recognize the inheritance
> from the other nutch classes. When a class is called to define a
> variable, i get an error message: "*class* cannot be resolved to a
> type". Some of this may stem from the inability to import packages: "The
> import org.apache.lucene cannot be resolved"//one example//
> 
> More specifically, all classes have this sort of problem:
> public boolean isPrunable(Query q, IndexReader reader, int docNum)
> throws Exception{
>            Document doc = reader.document(docNum);
>            String url = doc.get("url");
> //Error: Query cannot be resolved to a type
> //Error: IndexReader cannot be resolved to a type
> //Error: Document cannot be resolved to a type
> 
> Eclipse Properties:
> I have followed the tutorial and have a build path with the conf/
> directory. Under the java build path I have included as sources all the
> files in the nutch directory. Each pull down tab has:
> Included: (all)
> Excluded: (none)
> Native library location: (none)
> Under Projects tab in the build path I do not have anything when I try
> to add a project there are no projects to add.
> Libraries include the two .jar files added from the tutoiral:
> http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-mp3/lib/
> http://nutch.cvs.sourceforge.net/nutch/nutch/src/plugin/parse-rtf/lib/
> and the system library.
> The Order and Export tab has all the nutch folders with its plugins.
> 
> If you could direct me to be to be able to resolve these variables and
> allow Eclipse to inherit each class in the nutch directory, it would be
> much appreciated.
> 
> ~Jon
>