0

An external java library is treated as "package only containing non Java resources" (as indicated by the white icons as opposed to brown; the description in quotes is taken from here). When I try to import the library it cannot be resolved, so it seems it really isn't being recognised (in other words it's not just a case of eclipse showing wrong icon).

enter image description here

Two people have commented that my screenshots are not helping, so let me explain the intention behind them. The first one above is to show the difference between how my libraries are displayed. Htmlparser is a folder with .java files just like SPMF and works fine. Commons-lang and vecmath are .jars. SPMF cannot be resolved when I try to import it. The reason the screenshot is cropped this way is to highlight that all of the folders in SPMF are showing white which apparently means they are not recognized.

This is only the second time I'm using an external library, but I think I did everything the same as the first time.

enter image description here

This screenshot is intended to show how SPMF is added at the moment.

The library I am trying to add is SPMF - more specifically the Hierarchical Clustering algorithm. This is only a minor component of SPMF but it's the best Hierarchical Clustering solution I could find. It works fine if I just import it into a new project. So I could just bodge it by moving my code into that project if I can't get it going otherwise.

I presume that if a package can form a standalone project then it can also be used as an external library - or am I wrong?

I'm sure it's a stupid mistake I'm making but I've had no luck with google. This is the nearest I could find; Refresh seems the only applicable solution and it doesn't help.

Edit, SPMF is also available as a jar, it's missing some features but not the ones I need. I've been able to add the jar and the import the algorithm I need. It's enough of a workaround for me to move on and keep going. But it's not a solution and the question remains open.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
pateksan
  • 160
  • 1
  • 12
  • Your screenshots aren't really very helpful as to seeing what the actual error or problem is. And I would strongly advise that if you're getting into including external libraries into your projects to start using a build tool like maven or gradle. – Anthony Cathers Dec 31 '19 at 00:34
  • Is just how eclipse show the library in "package explorer" or you have an error using it? if it's the first, try with this: right click on library, Build Path, Configure Build Path, select Libraries Tab, select spmf, select "Visible only for test sources...", click "Toggle" button, click "Apply" button and after that do the same again to restore it.. You will see the icon as "class folder without attached source" – Diego B Dec 31 '19 at 00:56
  • Your screenshots aren't not clear but if we want to use some external library in eclipse, so we may use maven build or from application properties, add external jars. – Vivek Dec 31 '19 at 10:26
  • @DiegoBaranowski finally tried your suggestion, no luck. – pateksan Jan 01 '20 at 00:17

0 Answers0