We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Libraries -still confused about where to put...
Page Index Toggle Pages: 1
Libraries -still confused about where to put... (Read 3725 times)
Libraries -still confused about where to put...
Mar 27th, 2010, 2:16pm
 
I've been using Proscessing for a while, but I'm still confused about where to put libraries - I just downloaded G4P (great looking new sliders), and I put the jar file in the recommended place - in the sketches/libaries folder.... but didn't work. Then I put it in processing/libraries/ - still didn't work. I know you can always put it in a "code" folder in the sketch directory, which I ended up doing, and it worked.

But now I have library files all over the place and I'd like to clean them all up and just have them all in the right place.....

Using Processing 1.09, Windows XP.
Re: Libraries -still confused about where to put...
Reply #1 - Mar 27th, 2010, 2:59pm
 
the files need to be in your processing sketches libraries folder. Dont know where your sketcbook is but you can check that under files - preferences...
dont put there jars in there, you need to create another folder with the name of the library. most of the times the libraries are already packed that you can just unpack them into your libraries folder.
But the folder needs to be named after your main jar file, that is in the "library" folder of the library if it doesnt already exist when unpacking
Hope that makes sense somehow Smiley
Re: Libraries -still confused about where to put...
Reply #2 - Mar 27th, 2010, 3:20pm
 
Makes sense...and I thought it might be something like this.  Works with ControlP5, works with Ess.... doesn't work with G4P. The main file is called guicomponents.jar .I renamed the folder to "guicomponents" and put the jar file in there...but still doesn't work....
Re: Libraries -still confused about where to put...
Reply #3 - Mar 27th, 2010, 3:22pm
 
alright, i will test g4p. will be back in a sec
Re: Libraries -still confused about where to put...
Reply #4 - Mar 27th, 2010, 3:27pm
 
alright, works fine for me.
Dont put the jar in there.
When downloading the zip archive. unpack everything in there into a new folder called "guicomponents" into your libraries folder.

so there should be something like this then

libraries/guicomponents/library/guicomponents.jar


Re: Libraries -still confused about where to put...
Reply #5 - Mar 27th, 2010, 3:57pm
 
That works... I think what happened is that when I tested it the first time I deleted the jar file from the "code" directory but left the code directory there. So even though the library was in the right place, the program was still looking in "code" for it....

A mystery solved... thanks.

And this solved the problem of the sketch not working on openprocessing too...it didn't like the library being in the local folder.
Re: Libraries -still confused about where to put...
Reply #6 - Apr 13th, 2010, 8:52pm
 
This has given me trouble for two years on OSX.  I just resort to putting the libraries in a "code" directory in the directory of your sketch.  So let's say your sketch is called "Sketch_apr13a" then goto that directory, make a new directory called "code" and drop any *.jar" files in there.  

For sure it likely is the wrong way of doing things but it works way better and simpler than the correct way..it could be that it's not optimal to do this.  As long as it works i don't really care.

Re: Libraries -still confused about where to put...
Reply #7 - Apr 18th, 2010, 7:55am
 
Hello, I'm new on Processing and using it on a Mac OS 10.5.8.
I'm also a bit confused with the libraries. Trying to use controlP5 library, I have put the whole extracted directory into my sketchbook directory. I end up with :
sketchbook/libraries/controlP5/(various subdirs)
and a sketch
sketchbook/myfirstsketch/myfirstsketch.pde

and I get some 'missing library' error message when I try to run some controlP5 examples.
If I use the workaround indicated by nikp in the previous message, everything runs ok.
Am I making something wrong during the library installation ?

Thanks.
Re: Libraries -still confused about where to put...
Reply #8 - Apr 18th, 2010, 8:10am
 
Can you pull up the offending library using the sketch / import library widget from the menu-bar
Follow Cedrics instructions not nikps.
Unless you place the library in the "right" directory you will have issues if you want to export applets. Smiley
See http://processing.org/discourse/yabb2/num_1271396089.html
Re: Libraries -still confused about where to put...
Reply #9 - Apr 18th, 2010, 8:52am
 
Quote:
This has given me trouble for two years on OSX.  I just resort to putting the libraries in a "code" directory in the directory of your sketch.  So let's say your sketch is called "Sketch_apr13a" then goto that directory, make a new directory called "code" and drop any *.jar" files in there.  

For sure it likely is the wrong way of doing things but it works way better and simpler than the correct way..it could be that it's not optimal to do this.  As long as it works i don't really care.


It might work but it is a bad idea and will ultimately create a lot of work for you to create and maintain your sketches . Sad

It is worth the effort to get it to work the way it was intended so here is a little guide to how the libraries are organized in your sketch folder.

Staring with your sketch folder which was created when you installed Processing

Processing
       your sketch folders
       libraries
               library_name
                      examples
                      library
                      reference
                      src


The folder names in red should not be changed those in blue are your sketches (one per sketch) and the purple correspond to the library name (one for each library downloaded.

Each library folder will have up to 4 sub folders
examples
library
reference
src

The most important and the only one absolutely required is the library folder because it is inside here the library jar should be placed. An installation that has ControlP5 and Shapes3D for instance will look like this.

Processing
       your sketch folders
       libraries
              controlP5
                      examples
                      library

                             controlP5.jar
                      reference
              shapes3d
                      examples
                      library

                             shapes3d.jar
                      reference
                      src

I have this structure on both my PC and Mac and both are working as it should with no problem whatsoever.

Smiley
Re: Libraries -still confused about where to put...
Reply #10 - Apr 18th, 2010, 9:22am
 
Thanks all. I don't know why but the library is now recognized by Processing in it's standard place. I didn't change anything besides restarting Processing which might be a clue.
Solved for me.
Re: Libraries -still confused about where to put...
Reply #11 - Apr 18th, 2010, 10:32pm
 
Quark wrote on Apr 18th, 2010, 8:52am:
I have this structure on both my PC and Mac

I always wondered why Macs are opposed to PC by lot of people. Macs are personal computers as well, no  Shocked

Nice explanation BTW, I should point to here next time I see such question!  Cheesy
Re: Libraries -still confused about where to put...
Reply #12 - Apr 19th, 2010, 8:50am
 
Quote:
I didn't change anything besides restarting Processing which might be a clue.


Processing builds the list of available libraries on startup so if you add a library you must restart Processing for it to be available.
Smiley
Page Index Toggle Pages: 1