set data folder location for PApplet triggered through runSketch
<p>I'm running a Processing sketch (a <code>PApplet</code> subclass, created by exporting from a Processing sketch) from Clojure. The basic process is</p>

<ol>
<li>export sketch</li>
<li>locate jar files in exported application</li>
<li>install these jar files into local maven repo</li>
<li>load the libs in clojure using <code>lein</code></li>
</ol>

<p>The code is in <a href="https://github.com/benswift/clojure-processing-sketch-example/tree/minimal-example" rel="nofollow">this GH repo</a>, including (reasonably) minimal instructions for how to get set up and reproduce the problem.</p>

<p>Loading basic sketches works, but when I create a sketch which calls e.g. <code>loadImage()</code> to load an image from my <code>data</code> folder, the sketch can't find it.</p>

<p>I know this is convoluted way to do this - this is partially a learning exercise for me and partially the fact that I'm a lisp guy but not a JVM guy.</p>

<p>Is there any way to dynamically tell the <code>PApplet</code> subclass where its data folder is? Or am I stuck putting absolute paths everywhere?</p>

<p>EDIT: Ugh, what a mess. It looks like the problem is that I'm actually wrapping each <code>PApplet</code> subclass in a clojure <code>proxy</code> (so that I can intercept certain methods and make the various sketches play nice together) but the way Processing finds the data path involves <a href="https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java#L7588" rel="nofollow">looking at the ProtectionDomain to find the root source path</a>, so this won't work as I'm currentyly trying it. Back to the drawing board...</p>