javajarprocessingqhull

Processing cannot find library


I've tried importing from a jar file (quickhull3d for example) in Processing 2.2.1 and 3.2.1 on Linux and Mac based on the instructions given here

My directory structure looks like this

../Processing/Sketchbook/libraries/quickhull3d/library/quickhull3d.jar

The Processing IDE preferences set the sketchbook location to ../Processing/Sketchbook

In my .pde file, I have the opening line

import quickhull3d.*;

and I get the error:

No library found for quickhull3d Libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

Note: I have seen this question asked repeatedly both here and on the Processing forum and to the best of my ability to tell, I am following the instructions as written. I have restarted the IDE before attempting to run the sketch and I have also tried copying quickhull3d.jar to /mysketch/code, which is manually doing what the IDE would do if you were to drag and drop the file onto it.

Follow up: Upon further investigation, it looks like the problem is that the .jar file itself does not point to the correct locations for the xyz.class files, so I believe this may be the culprit. Additionally, I discovered that the ComputationalGeometry contributed library for Processing contains QuickHull3d, obviating the need for me to install it manually. In the future, I will make certain the paths in the .jar are correct.


Solution

  • If you're using the Processing editor, the easiest way to install a non-standard library is to just drag the .jar file onto your Processing editor. This will move the .jar file into your sketch folder, and you can use it just like you can use any other library.