Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Eclipse not finding classes.
Eclipse not finding classes. [message #215763] Wed, 18 June 2008 17:41 Go to next message
Eclipse UserFriend
Originally posted by: jim.fayettedigital.com

I have a jar file with classes, but they are not included in a package.
The jar is in the WEB-INF/lib directory however I get errors saying
things like Stem cannot be resolved to a type. However the jar file has
a Stem class in it.

source line:
Stem stem = new Stem("english");



jar -tf ~/ProjectWorkspace/JXSearch/WebContent/WEB-INF/lib/xapian_jn i.jar
META-INF/
META-INF/MANIFEST.MF
Auto.class
BM25Weight.class
BoolWeight.class
....
SimpleStopper.class
Sorter.class
Stem.class
Stopper.class
StringValueRangeProcessor.class
SWIGTYPE_p_std__string.class
TermGenerator.class
....

I was using an older version of the library that had things in a package
but the authors decided to use SWIG rather than hand code and for some
reason didn't put the library in a package.

Any thoughts as to how I can reference this library correctly?

THanks,
Jim.
Re: Eclipse not finding classes. [message #215804 is a reply to message #215763] Thu, 19 June 2008 08:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Jim,

placing JARs in WEB-INF/lib is sufficient, Eclipse should find them.
How did you add the JAR to WEB-INF/lib? Did you copy it in the file system, or
did you add it through eclipse? If you did it the first way: have you
"Refreshed" your project (option in context menu)?

Best regards

Wolfgang

Jim Lynch schrieb:
> I have a jar file with classes, but they are not included in a package.
> The jar is in the WEB-INF/lib directory however I get errors saying
> things like Stem cannot be resolved to a type. However the jar file has
> a Stem class in it.
>
Re: Eclipse not finding classes. [message #215812 is a reply to message #215804] Thu, 19 June 2008 08:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jim.fayettedigital.com

Wolfgang Knauf wrote:
> Hi Jim,
>
> placing JARs in WEB-INF/lib is sufficient, Eclipse should find them.
> How did you add the JAR to WEB-INF/lib? Did you copy it in the file
> system, or did you add it through eclipse? If you did it the first way:
> have you "Refreshed" your project (option in context menu)?
>
> Best regards
>
> Wolfgang
>
> Jim Lynch schrieb:
>> I have a jar file with classes, but they are not included in a
>> package. The jar is in the WEB-INF/lib directory however I get errors
>> saying things like Stem cannot be resolved to a type. However the jar
>> file has a Stem class in it.
>>
Hi Wolfgang,

I did refresh numerous times. I copied it outside of Eclipse. It's
showing up in the list of libraries in the Project Explorer/Java
resources:src/Libraries.

The problem seems to be that there are no packages defined for the
classes in the jar file. I have the source code and there are none in
the sources either. These files were produced with Swig from C++ source.

Jim.
Re: Eclipse not finding classes. [message #215944 is a reply to message #215763] Mon, 23 June 2008 17:22 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Jim Lynch wrote:
> I have a jar file with classes, but they are not included in a package.
> The jar is in the WEB-INF/lib directory however I get errors saying
> things like Stem cannot be resolved to a type. However the jar file has
> a Stem class in it.
>
> source line:
> Stem stem = new Stem("english");
>
>
>
> jar -tf ~/ProjectWorkspace/JXSearch/WebContent/WEB-INF/lib/xapian_jn i.jar
> META-INF/
> META-INF/MANIFEST.MF
> Auto.class
> BM25Weight.class
> BoolWeight.class
> ...
> SimpleStopper.class
> Sorter.class
> Stem.class
> Stopper.class
> StringValueRangeProcessor.class
> SWIGTYPE_p_std__string.class
> TermGenerator.class
> ...
>
> I was using an older version of the library that had things in a package
> but the authors decided to use SWIG rather than hand code and for some
> reason didn't put the library in a package.
>
> Any thoughts as to how I can reference this library correctly?
>
> THanks,
> Jim.

The Java language has always required imported classes be in a package.
However, it wasn't until Java 1.4 that the Sun compiler enforced this
restriction. It broke a lot of JSPs when people upgraded from Java 1.3
to 1.4. But that was a while ago. In this day and age, I don't see how
a library jar with un-packaged classes with be useful for anything.

Cheers,
Larry
Previous Topic:Name jdbc is not bound in this Context
Next Topic:Merging content for web.xml during facet install
Goto Forum:
  


Current Time: Thu Apr 25 02:12:17 GMT 2024

Powered by FUDForum. Page generated in 0.03287 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top