Loading...
Logo
Processing Forum
Hello - 

I'm developing my first processing library and simultaneously learning Eclipse.  Before developing the library the code, and included libraries all worked as referenced classes stored as separate files in the processing IDE.  Converting those referenced files to libraries because they need to more widely used.

The library itself references an external library which causes a java.lang.NoClassDefFoundError when referenced during runtime.  There are no compilation issues.  This is the error when I run a sketch referencing my library (which references the included library) from the processing IDE (for some reason when run from Eclipse it still seems to get the error, but doesn't report it to the Console).  [sketch is HeartCircle, my lib is heartstuff.HeartStream, missing lib included in HeartStream is jtransforms.fft.FloatFFT_1D]

Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: edu/emory/mathcs/jtransforms/fft/FloatFFT_1D
at heartstuff.HeartStream.getDominantFreq(Unknown Source)
at HeartCircle.draw(HeartCircle.java:200)
at processing.core.PApplet.handleDraw(PApplet.java:1631)
at processing.core.PApplet.run(PApplet.java:1530)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ClassNotFoundException: edu.emory.mathcs.jtransforms.fft.FloatFFT_1D
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 5 more

I've tweaked every reference to classpath I could find in Eclipse GUI (preferences for library and sketch), and the build.properties file for the sketch and my problem library seems to consistently be there.

I have a feeling I'm missing something simple in Eclipse settings or the ANT configuration but not sure what.  Please let me know what more info I can provide.

Eclipse Juno sp2
Processing 1.5.1

Replies(3)

Are the jars of the 3rd party library in the same folder than your own library jar in the library folder of your sketchbook?
I hoped and feared (mostly hoped) it would be something that simple.  Working now.   Thank you.  

My assumption was that the classpath at runtime should find the 3rd party jar in the same location as it was during compilation?  Is this the ideal scenario?  Or is the correct location for the 3rd party jar in my library folder?
I am not too sure, but I am suspecting that Processing builds the classpath depending on the libraries imported in the current sketch. So if only your library references them, you are out of luck.