Any advice for people who have used Eclipse with processing (especially for Library development) greatly appreciated.
I’m curious about best practices – specifically, how you connect core.jar to Eclipse, and how/if that should be checked in to version control (e.g. github) when developing a Processing Library.
The issue: I’m an inexperienced Eclipse user, but I’m a bit put off that when I follow the Processing Library template instructions, Eclipse writes an absolute local path into my .classpath file, including my username (not portable). I’m trying to decide whether to 1) exclude the .classpath from the new library repository, or 2) leave it in but unconfigured, or 3) configure it into a relative path with something more portable like a path variable (like WORKING_DIR)… or something else?
Locate and add Processing’s
core.jarto your build path. It is recommended that a copy of
core.jaris located in your Eclipse workspace in a
If you created a
libsfolder as described above, put the libraries you need to add to your classpath in there. In the “Properties” of your Java project, navigate to Java Build Path → Libraries, and click “Add External JARs…”. Select the
.jarfiles from the
libsfolder that are required for compiling your project. Adjust the
build.xmlfile accordingly. The
libsfolder is recommended but not a requirement, nevertheless you need to specify where your
.jarfiles are located in your system in order to add them to the classpath.
If you follow the instructions and copy core.jar into
yourworkspace/libs, then select it as
Add External JAR, then Eclipse does something like this in the .classpath:
Here are some example I have found of what established libraries are doing.
- The grafica library follows the Template instructions and checks in the .classpath – so it contains
- The Picking Library originally had one of these local paths that you get by following the Template instructions –
path="/home/nico/workspace/libs/processing2/core.jar"– but then stripped it back out.
- PeasyCam has a generic .classpath – not sure how / if Processing is included in the working project outside build.xml / build.properties.
Timing Utils just doesn’t include any of it – .classpath, .project, etc., and they aren’t included in a .gitignore. Perhaps the library project wasn’t developed in Eclipse at all. https://github.com/Lord-of-the-Galaxy/Timing-Utilities/tree/master/timing_utils
Drop is the same way – no Eclipse project files or ant build files https://github.com/transfluxus/drop
MostPixelsEver points to a root (?) directory called
/processing-core/– so does Box2D
I didn’t find any existing library examples of what I would first think to do, which is:
- myProject > Properties > Resources > Linked Resources > Path Variables > New > WORKSPACE_LOC
- myProject > Properties > Java Build Path > Add Variables > WORKSPACE_LOC > Extend > libs/core.jar
This creates a config line like this:
<classpathentry kind="var" path="WORKSPACE_LOC/libs/core.jar"/>