The Data Mining Forum                             open-source data mining software open-source data mining software data science journal data mining conferences
This forum is about data mining, data science and big data: algorithms, source code, datasets, implementations, optimizations, etc. You are welcome to post call for papers, data mining job ads, link to source code of data mining algorithms or anything else related to data mining. The forum is hosted by P. Fournier-Viger. No registration is required to use this forum!.  
Eclipse treats folder of java files as “package only containing non Java resources”
Posted by: pateksan
Date: January 01, 2020 09:48AM

Hello,

Please bear with me, I'm new to java etc.

When I try to add SPMF as an external folder, Eclipse treats it as “package only containing non Java resources” as shown in this SO question.

I've worked around it by using the jar which seems to work. But I'd love to known if I'm doing something wrong or if it's an issue with SPMF. Please see the SO post and let me know through either channel if more info is needed to assess this.

Options: ReplyQuote
Re: Eclipse treats folder of java files as “package only containing non Java resources”
Date: January 01, 2020 10:17PM

> Hello,

> Please bear with me, I'm new to java etc.

>When I try to add SPMF as an external folder, Eclipse treats it as “package only containing non Java resources” as shown in this SO question.

>I've worked around it by using the jar which seems to work. But I'd love to known if I'm doing something wrong or if it's an issue with SPMF. Please see the SO post and let me know through either channel if more info is needed to assess this.

Hi,

Thanks for using SPMF

It is more of a problem of how you are adding the code in your project because the code of SPMF don't have any special features that should prevent it for being recognized as a java program. It is just some Java code organized into packages (folders). There is no dependencies to other projects.

So what is the problem. I think it is just how you have added the code to your project.

If you want to include all the code of SPMF in your project, there are some simple instructions that you can follow step by step here: http://www.philippe-fournier-viger.com/spmf/how_to_install.txt

If you want to only include an algorithm (the hierarchical clustering algorithm), then I wrote some text explaining how to do that in the FAQ on the website:

Copying the source code of an algorithm in another Java project
Reusing the source code of a single algorithm from SPMF in another Java project is easy, since in general algorithms in SPMF are separated by packages, except for a few datastructures and classes that are shared by multiples algorithms.

If you want to reuse a single algorithm from SPMF without copying all the code from SPMF, you should first determine which classes are necessary. For example, if you want to copy the source code of the SPAM algorithm in another project, then you would need to first locate the package for the SPAM algorithm. It is ca/pfv/spmf/algorithms/sequentialpatterns/spam_saveToFile/ .

Then, you would need to copy the file AlgoSPAM.java in this package, as well as other files used by that file which are: AlgoSPAM. java, Bitmap.Java, Itemset.java and Prefix.Java.

Then you should check the first lines of those Java files in that package to see if there is some additional files that are required by looking at the import statements of each file. In the case of SPAM, there is only two such files indicated by the import statement in AlgoSPAM.java, which are:

ca.pfv.spmf.patterns.itemset_list_integers_without_support.Itemset;
ca.pfv.spmf.tools.MemoryLogger;
Therefore, we should also copy these files. Then we should also look at the import statement and dependency of these files to see if other files are required.

Note that each Java file has a package statement in its first line. If you move the files to another package, you should change the package statements accordingly.

Also, note that the source code of SPMF is distributed under the GPL license. If you copy parts of the source code of SPMF in another project, it should comply with the GPL license (see license).


If this does not help you, you can let me know. I can give more explanations.

Best regards,

Philippe

Options: ReplyQuote
Re: Eclipse treats folder of java files as “package only containing non Java resources”
Posted by: pateksan
Date: January 03, 2020 04:10PM

Thanks Philippe.

I'm aware of the instructions and the FAQ, I was just curious in case there was a well known reason why Eclipse treated the folder the way it did.

Nevermind for now, hopefully it becomes obvious one day. Thank you for offering more explanations but I don't want to take up more time than necessary. I've come up with several more burning problems since posting anyway, but I will post them separately.



Edited 1 time(s). Last edit at 01/03/2020 04:28PM by pateksan.

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.