How to deploy library that requires Processing's Serial class

Hi everyone,

I'm currently in the process of wrapping up the initial phase of a library project for a bit of hardware that requires serial communication. Everything worked out nicely using the processing eclipse library template – but now I'm running into trouble when setting it up for the Processing IDE. Whats best, putting the serial.jar + native extras into the library folder as dependency (as advised in serval docs). Or not?

A) Deploying it with the library as a dependency works fine when compiling it in eclipse and deploying it via ANT. But problems pop up when you want to work with Serial inside the sketch thats importing the library. Not having the import statement inside your sketch class will obviously produce Cannot find anything named "Serial". But if you do so via import processing.serial.*; you get More than one library is competing for this sketch. The import processing.serial points to multiple libraries:; pretty bad. Anyhow, this approach is fine as long as you don't want to use Serial inside your sketch.

B) Deploying no other dependencies (no core.jar, serial.jar etc.) seems to be the cleanest way. Everything works as long as import processing.serial.*; is part of the import statements. But how can I make it happen that it is automatically added when adding the actual library via Sketch -> Import Library... ?

Any ideas? Thanks!

Answers

  • lynlyn
    edited May 2014

    try this?

    resources/build.properties

    # Add all jar files that are required for compiling your project to the local 
    # and project classpath, use a comma as delimiter. These jar files must be 
    # inside your classpath.local.location folder.
    
    classpath.local.include=core.jar
    classpath.local.include=serial.jar
    
  • lynlyn
    edited May 2014

    confirm that your classpath is all right and your serial.jar is in the right place my classpath.local.location is

    classpath.local.location=${user.home}/Documents/Processing/libs

    then

    classpath.local.include=core.jar,serial.jar

    this worked for me good luck

Sign In or Register to comment.