We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everyone,
I'm trying to make a library which depends on the core.jar and serial.jar from Processing. I couldn't figure out how to have multiple class paths, so I copied both the jars and their respective native libraries into a folder and set that as "classpath.local.location" in the build.properties. I also added the libraries as external jars to eclipse. For some reason, it can't find "Serial" as a symbol though. Why is this? Also, if anyone knows how I can reference both libraries directly from Processing instead of copying them that'd be great too!
Thanks you for sacrificing your precious time to help. Here's the log from an ant build. I copied the part in question below but I have the full log too.
Part in question:
[javadoc] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src/jsonrpc/library/JSONRPC.java:49: error: cannot find symbol
[javadoc] private Serial serial;
[javadoc] ^
[javadoc] symbol: class Serial
[javadoc] location: class JSONRPC
[javadoc] javadoc: warning - Error fetching URL: http://processing.org/reference/javadoc/core/
Full:
Buildfile: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/resources/build.xml
init:
[echo] ------------------------------------------------------------------------------------------------
[echo] Building the Processing library JSONRPC 1
[echo] ------------------------------------------------------------------------------------------------
[echo] src path /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/src
[echo] bin path /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/bin
[echo] classpath.local /Applications/Processing/defaultlibs
[echo] sketchbook /Applications/Processing
[echo] java version 1.7
[echo] ------------------------------------------------------------------------------------------------
[echo]
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/bin
library.init:
[echo] init library ...
library.run:
[echo] building library ...
generate.structure:
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/library
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/examples
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/reference
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/examples
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src
generate.source:
generate.source.win:
generate.source.nix:
[echo] generating source (mac/linux) ...
parse.file:
[echo] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src/jsonrpc/library/JSONRPC.java
compile:
[javac] Compiling 1 source file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/bin
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[copy] Copied 1 empty directory to 1 empty directory under /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/bin/data
generate.jar:
[jar] Building jar: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/library/JSONRPC.jar
generate.javadoc:
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] Loading source file /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src/jsonrpc/library/JSONRPC.java...
[javadoc] Constructing Javadoc information...
[javadoc] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src/jsonrpc/library/JSONRPC.java:32: error: package processing.serial does not exist
[javadoc] import processing.serial.*;
[javadoc] ^
[javadoc] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/src/jsonrpc/library/JSONRPC.java:49: error: cannot find symbol
[javadoc] private Serial serial;
[javadoc] ^
[javadoc] symbol: class Serial
[javadoc] location: class JSONRPC
[javadoc] javadoc: warning - Error fetching URL: http://processing.org/reference/javadoc/core/
[javadoc] Registered Taglet ExampleTaglet ...
[javadoc] Standard Doclet version 1.8.0_77
[javadoc] Building tree for all the packages and classes...
[javadoc] Generating /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/reference/constant-values.html...
[javadoc] Copying file StandardDocFile[file:/Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/resources/stylesheet.css] to file stylesheet.css...
[javadoc] Building index for all the packages and classes...
[javadoc] Building index for all classes...
[javadoc] Generating /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/reference/help-doc.html...
[javadoc] Note: Custom tags that could override future standard tags: @example. To avoid potential overrides, use at least one period character (.) in custom tag names.
[javadoc] 3 warnings
generate.libprops:
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC
parse.file:
[echo] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp/JSONRPC/library.properties
copyToSketchbook:
[echo] copying files to the libraries folder in your sketchbook.
[delete] Deleting directory /Applications/Processing/libraries/JSONRPC
[mkdir] Created dir: /Applications/Processing/libraries/JSONRPC
[copy] Copying 19 files to /Applications/Processing/libraries/JSONRPC
generate.distribution:
[delete] Deleting directory /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/JSONRPC
[move] Moving 19 files to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1
generate.install.library:
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1
parse.file:
[echo] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/README.md
generate.web:
[mkdir] Created dir: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web
[copy] Copying 15 files to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/reference
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/examples
[copy] Copying 2 files to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web
parse.file:
[echo] /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/index.html
processExamples:
addExamples:
[echo] Hello
generate.zip:
[move] Moving 19 files to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/tmp/JSONRPC
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/download
[zip] Building zip: /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/JSONRPC.zip
[move] Moving 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/download
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/download
[copy] Copying 1 file to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/web/download
[move] Moving 22 files to /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1
[delete] Deleting directory /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/distribution/JSONRPC-1/tmp
[delete] Deleting directory /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/tmp
clean:
[delete] Deleting directory /Users/Reenforcements/Documents/BeginningJava/Eclipse/JSONRPC/processing-library-template-3.0.1/bin
[echo]
[echo] ------------------------------------------------------------------------------------------------
[echo] Name JSONRPC
[echo] Version 1.0.0 (1)
[echo] Compiled normal
[echo] Sketchbook /Applications/Processing
[echo] ------------------------------------------------------------------------------------------------
[echo] done, finished.
[echo] ------------------------------------------------------------------------------------------------
[echo]
BUILD SUCCESSFUL
Total time: 3 seconds
Answers
Ant can't even find "println"? I don't understand why. I'm including both "import processing.core.*; import processing.serial.*;"
EDIT: Oops, okay, so println is actually a method of PApplet. This part makes sense now.
I've perused some Processing library sources and most of them can successfully
import
from "processing.core". It's located @ "core\library\" btW.The other bundled libraries (dxf, io, net, pdf, serial, svg) are located @ "modes\java\libraries\".
Serial more precisely @ "\modes\java\libraries\serial\bin\processing\serial\Serial.class".
I'm also interested on how to build Processing libraries as well.
Hope some1 more experienced in it shows up here. 8-X