Adding Java Library (joda, commons collection)

I've been trying to add java libraries to Processing 2.1. Used the format in the info page. http://wiki.processing.org/w/How_to_Install_a_Contributed_Library#Manual_Install. But it doesn't seem to work. I must be missing something here. This is the same structure as the old library it is replacing (joda). I've restarted program and system to no avail. I changed library-folder names to be Processing compliant, do I have to do all the jar files? I didn't before. - Do I have to change permissions perhaps?

files inside the Processing/libraries/ folder which has all the ones imported via the pulldown installer are:

commonscollections4
____ apidocs
____ library
________ commons-collections4-4.0-javadoc.jar
________ commons-collections4-4.0-sources.jar
________ commons-collections4-4.0-test-sources.jar
________ commons-collections4-4.0-tests.jar
________ commonscollections4.jar
____ LICENSE.txt
____ NOTICE.txt
____ README.txt
____ RELEASE-NOTES.txt

JodaTime
____ library
________ joda-time-2.3-javadoc.jar
________ joda-time-2.3-sources.jar
________ JodaTime.jar
____ LICENSE.txt
____ NOTICE.txt
____ pom.xml
____ RELEASE-NOTES.txt
____ src

Answers

  • edited December 2013

    files inside the Processing/libraries/

    You should never touch the folder where Processing is installed!!! [-X
    User libraries are installed inside subfolder "/libraries" from our chosen "/sketchbook" folder! :-B

  • So just a bit of misdirection on my part there. :| oops. I put my sketchbook in a different location (incl in prefs), it is called 'Processing' but is not the Processing.app file. Processing is the name of the 'sketchbook'. Wonder if that is an issue. for example, path to JodaTime is /Volumes/TravelBrick_Big/Documents/Processing/libraries/JodaTime/library/JodaTime.jar

  • edited December 2013

    Tried changing sketchbook folder name, which I find Processing.app by default creates as 'Processing'. Didn't change anything the joda library still not found. tried
    import org.joda.*; //this should be correct I think
    import joda.*; //
    import JodaTime.*; //

    and all returned that library was missing.

  • Answer ✓

    I have installed, for example, Apache Collections. At the following path:

    H:\PhiLhoSoft\Processing\libraries\ApacheCommonsCollections\library\ApacheCommonsCollections.jar

    where Processing is the name of my sketchbook.

    I just checked and it is still working in 2.1.

    Basically, you are doing it right, so I am not sure what the problem is.

    http://bazaar.launchpad.net/~philho/+junk/Processing/view/head:/_QuickExperiments/_Libraries/ApacheFifo/ApacheFifo.pde

    Add import java.util.*; at the start.

  • OK So I sorted out the problem importing/loading Apache Commons Collections library. I used the processing 'pulldown' for inserting text for import of library (I usually type it in) and it turns out the collection has a different name now '.... collections4'.

    So this is a lesson in using the library import utility.

    (philo - collection4 doesn't have '.buffer' so that example doesn't load with newest library)

    But the Joda Time library doesn't show up in the pull down....?? Strange.

  • This is a bug. I guess time for report... The library shows up in the pulldown and is accessible by a sketch if it is in the expected/default location for added libraries, but not if the sketch folder is in a custom location. Since Philo looks to be on PC I'm guessing this is a Mac issue.

    Joda Time has the same issue.

Sign In or Register to comment.