We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Import libraries into the classpath
Page Index Toggle Pages: 1
Import libraries into the classpath (Read 981 times)
Import libraries into the classpath
Dec 5th, 2008, 9:43am
 
How is Processing adding the library .jar files to the classpath? I'm trying to add a library-import feature to the Emacs processing-mode but even with the .jar files added to the classpath I get a NullPointerException. This happens with any library that I try even when not creating any objects that use a class from the library!

Thanks for any help,
Rudolf

*edit: I should also add the compile message...here it is:*

-*- mode: compilation; default-directory: "~/Code/artmusicplain/" -*-
Compilation started at Fri Dec  5 03:39:12

/home/omouse/Code/processing-1.0/java/bin/java -classpath "/home/omouse/Code/processing-1.0/java/lib/rt.jar:/home/omouse/Code/processing-1
.0/java/lib/tools.jar:/home/omouse/Code/processing-1.0/lib/antlr.jar:/home/omous
e/Code/processing-1.0/lib/core.jar:/home/omouse/Code/processing-1.0/lib/ecj.jar:
/home/omouse/Code/processing-1.0/lib/jna.jar:/home/omouse/Code/processing-1.0/li
b/pde.jar:/home/omouse/Code/processing-1.0/libraries/minim/library/jl1.0.jar:/ho
me/omouse/Code/processing-1.0/libraries/minim/library/mp3spi1.9.4.jar:/home/omou
se/Code/processing-1.0/libraries/minim/library/tritonus_share.jar:/home/omouse/C
ode/processing-1.0/libraries/minim/library/tritonus_aos.jar:/home/omouse/Code/pr
ocessing-1.0/libraries/minim/library/minim-spi.jar:/home/omouse/Code/processing-
1.0/libraries/minim/library/minim.jar:/home/omouse/Code/processing-1.0/libraries
/minim/library/jsminim.jar" processing.app.Commander --sketch="/home/omouse/Code/artmusicplain/" --output="/home/omouse/Code/artmusicplain/output" --build
Exception in thread "main" java.lang.NullPointerException
     at processing.app.Sketch.preprocess(Sketch.java:1415)
     at processing.app.Sketch.build(Sketch.java:1471)
     at processing.app.Commander.<init>(Commander.java:198)
     at processing.app.Commander.main(Commander.java:95)

Compilation exited abnormally with code 1 at Fri Dec  5 03:39:13
Re: Import libraries into the classpath
Reply #1 - Dec 5th, 2008, 12:46pm
 
The NPE looks like being because the Base.importToLibraryTable, which is a HashMap, isn't initialized.
It is created in rebuildImportMenu(), itself called by buildSketchMenu() which seem tied to PDE GUI.

Last time I checked, command line support isn't finished yet.
Mmm, the list of revisions confirms this:
Quote:
PROCESSING 1.0 (REV 0162) - 24 November 2008
[...]
+ Command line support arrived in a recent release, but is not working yet.
 http://dev.processing.org/bugs/show_bug.cgi?id=1048
Page Index Toggle Pages: 1