| Eclipse not finding classes. [message #215763] |
Wed, 18 June 2008 13:41  |
|
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 04:04   |
|
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 04:40   |
|
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 13:22  |
Larry Isaacs Messages: 1261 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
|
|
|
Powered by
FUDForum. Page generated in 0.07583 seconds