Processing (Java): List of reasons why a library won't be detected (Linux)

陌路散爱 提交于 2019-12-10 10:44:01

问题


There are apparently numerous reasons why Processing will not detect the installation of an external library.

1) Library installed in wrong folder

The library must be installed in a directory "libraries" in the sketchbook folder, which is probably not in the installation directory. Careful Linux is case sensitive so libraries and Libraries are two different directories, as are sketchbook and Sketchbook.

2) Library installed in correct folder but wrongly referenced

It's possible to confirm the current sketchbook directory used by Processing by looking in "Preferences" in the "File" menu of the Processing editor.

3) Problem with preferences.txt

Preferences.txt allows manual entries to be made. If you don't have a preferences.txt then there's no problem

4) Permissions on the folder itself

5) ??

And that is my question. For some reason, although everything is where it should be, Processing doesn't recognise SoundCipher when it has been dropped in as extracted from a zip file, as downloaded from the net and as instructed by every blog, readme file, etc I can find.

So I'm assuming there's something else that may cause havoc with Processing's ability to detect a library?

OS: Ubuntu 14 LTS

Error in editor is: The class SoundCipher does not exist

Error message is: No library found for arb.soundcipher No library found for arb.soundcipher.constants Libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

Sketchbook folder path: /home/steg/sketchbook

In Preferences, sketchbook path is: /home/steg/sketchbook

Path to library is: /home/steg/sketchbook/libraries/soundcipher

Path to source is: /home/steg/sketchbook/libraries/soundcipher/src

All other directories in soundcipher folder are as is... Yet the error is not related to soundcipher seemingly.

Code in Sketch:

 import arb.soundcipher.*; 
 import arb.soundcipher.constants.*;

 SoundCipher sc = new SoundCipher(this);

回答1:


The easiest way to add a library to a sketch is to simply drag the library jar onto the Processing editor.

You don't have to install the library in the libraries directory. Just find SoundCipher.jar and drag it directly onto your sketch in the Processing editor.

That will add the library to your sketch, and you'll be able to use the SoundCipher class.



来源:https://stackoverflow.com/questions/35672885/processing-java-list-of-reasons-why-a-library-wont-be-detected-linux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!