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 › paths to files in eclipse
Page Index Toggle Pages: 1
paths to files in eclipse (Read 786 times)
paths to files in eclipse
May 5th, 2008, 2:40pm
 
 I'm sorry for posting question after question, I am on a tight timeframe and I can't find any documentation on this.
 I am working with Processing in eclipse.
 In the Processing IDE you have to include your external files (like images) in the sketch's "data" directory.
 How do you do this in eclipse?? you just give it the hole path (didn't work)?? create a "data" folder on the project folder (also didn't work)??

 You guys have been really helpfull, thanks for everything!!

 David Jonas
Re: paths to files in eclipse
Reply #1 - May 5th, 2008, 2:54pm
 
 I found it on the alpha forum!

 Sorry for being lame on this one.... here's the answer anyway...


_________________________________________________

* setting up the data folder for a sketch
select the project node in the package explorer and then choose "file menu > new > folder". expand the project root node by clicking and select the "bin" folder as the parent for the new folder. type in "data" and press "finish". note: the /bin folder will only exist if you have created a source folder (step 4 above). if no source folder is specified, all source files will be stored in the project's root folder and hence the "data" folder has to be created at this level too.
_________________________________________________
in http://processing.org/discourse/yabb/YaBB.cgi?board=Integrate;action=display;num=1106256315


Bye Bye!!
Re: paths to files in eclipse
Reply #2 - Jul 14th, 2008, 1:40am
 
Here's how I got it Eclipse to include the files from the data directory at runtime :

- if it isn't there already, copy/create the data directory into your Eclipse project (on the same level as the src dir)

so

myProject
|__src
|__data
|____file1.ext
|____file1.ext
|____...
|__...


- refresh your project in Eclipse (RMB -> Refresh, or F5). You should now see the data dir and its contents reflected in Eclipse.

- make Eclipse aware that it has to include the files at runtime:  Eclipse -> Run menu -> Run Configurations -> Classpath -> User Entries -> Advanced -> Add Folders -> select the data dir
Re: paths to files in eclipse
Reply #3 - Jul 14th, 2008, 11:44am
 
Note, for the record, that you can always specify an absolute path. Bad for distributing, but OK for testing.

PImage niceImage = loadImage("D:\\_PhiLhoDocs\\DA\\SurfStyle.jpg");
or even
PImage niceImage = loadImage("D:/_PhiLhoDocs/DA/SurfStyle.jpg");
Page Index Toggle Pages: 1