Trying to use Apache Commons Math

edited May 2 in Library Questions

I'm trying to import math's DBScan from apache commons, but I have no idea if it's even possible to do this with Processing. If so, could someone please help me out?

Answers

  • If you got its ".jar" file, you can simply drag it into the Processing's IDE (PDE).

  • Thanks GoToLoop - and if I just have a bunch of .java files? I saw a similar question posted before, but the OP answered their own question, and didn't go to length explaining the process (https://forum.processing.org/one/topic/use-java-packages-inside-processing.html). Any help would be appreciated!

  • edited May 2

    If they're ".java" files, you can simply copy & paste them into the same folder as your ".pde" files. :bz

    Take a look at the sketch from these links below. They're for the same sketch btW: O:-)

    1. https://Forum.Processing.org/two/discussion/27733/countdown-class-library-for-java-js-python
    2. https://Gist.GitHub.com/GoToLoop/ea4db8a8622e27541213da3c9a43ca21

    That sketch is made of 1 ".pde" file: "CountdownClass.pde"
    And a ".java" 1: "Countdown.java"

  • Thanks GoToLoop! That's very helpful in explaining things - I think I get it now. I've been using Processing for simple graphics for a bit, but this is another level of complexity.

    If you don't mind, given that JSAT is some 500+ files java files, is there any way to import all of them en masse? Do I need to drag in all the files into my Processing sketch?(!)

  • edited May 2

    That seems a huge complex collection of libraries. @-)
    You really need to find its distribution ".jar" file on its own site. #:-S
    Or try out Maven: http://Search.Maven.org/#search|ga|1|a:"JSAT" [-O<

  • Thanks for the reference to search.maven Instead of dealing with JSAT, I figured I should type DBSCAN to see if anything came up, because that's all I'm after for now. I got two results (webjars and weka). These seem less complicated than JSAT (at least I got the .jar files!), but I'm still not sure how to use them. I've imported them into my sketch (by copying the .jar files into modes/java/libraries/..., but not sure where to go from there. :-?

    GoToLoop, do you think you can point me to any reference as to how to get them to work inside Processing? I'm extremely grateful for the help so far!

  • edited May 2 Answer ✓

    The easiest way to get a ".jar" file for a sketch is what I said in my 1st reply to you here: :-\"

    If you got its ".jar" file, you can simply drag it into the Processing's IDE (PDE).

    That'll will copy the ".jar" file to a subfolder called "code/". B-)

    However, if you prefer to make it available for all sketches, you need to read this wiki: :-B
    https://GitHub.com/processing/processing/wiki/How-to-Install-a-Contributed-Library

  • Thanks for all the help GoToLoop!

Sign In or Register to comment.