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 & HelpSyntax Questions › How to add jar file
Page Index Toggle Pages: 1
How to add jar file? (Read 883 times)
How to add jar file?
May 1st, 2009, 12:09pm
 
How would I add a jar file to my sketch? I tried sketch -> add file and added the .jar file. But it seems like processing doesnt see it, so I get errors. Any ideas? I'm trying to add jtwitter.jar. My code works fine in Java but it doesn't work in Processing.
Re: How to add jar file?
Reply #1 - May 2nd, 2009, 5:10am
 
Drag'n'drop the .jar file on the PDE window where the sketch is opened.
Or put the .jar file in a code folder in the sketch's folder.
Or treat it like a library.
Re: How to add jar file?
Reply #2 - May 3rd, 2009, 9:21pm
 
Hmm, when I did the sketch > add file the jar file did get put in the code folder. So I guess the jar is in there sucessfully but using it is the problem.

In java, the code would basically look like this:
Code:

import winterwell.jtwitter.*;
// Make a Twitter object
Twitter twitter = new Twitter("my-name","my-password");
// Print Daniel Winterstein's status
System.out.println(twitter.getStatus("winterstein"));
// Set my status
twitter.updateStatus("Messing about in Java");


I try the same thing in processing but I get a twitter-not-defined error when the object twitter is constructed. What could be going on? Thanks!
Page Index Toggle Pages: 1