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 & HelpPrograms › porting code from eclipse to processing
Page Index Toggle Pages: 1
porting code from eclipse to processing (Read 619 times)
porting code from eclipse to processing
Feb 25th, 2006, 9:15pm
 
I am not sure if this is an appropriate section to ask this question but here is the problem I have. I am using del.icio.us API to get some posts and tags etc. which is to be visualized in processing, right now I managed to to everything in the backend and I am thinking to port this code to processing so that I can start to build the front end and connect these two. I have copy pasted all the code from eclipse to processing and also I have put my external jar files which are needed for API in my /code folder. When I try to run the code it is giving this error:

java.lang.ClassCastException
at processing.core.PApplet.main(PApplet.java:5486)

I have later added import processing.core.*; on top of my every class and the extensions for the tabs are .java.
So what do you guys think of this, am I on the right track to transfer my code to processing, should I follow another way, any suggestions would be awesome!

thanks in advance
ilteri.s
Re: porting code from eclipse to processing
Reply #1 - Feb 25th, 2006, 9:22pm
 
I´m not sure about copy/pasting java code into processing since processing generates the code again from the sketch, hence the troubles first you ran into...
but anyway, wouldn't it be better if you made a library from ecplise and included it into sketch ?
this works well
Re: porting code from eclipse to processing
Reply #2 - Feb 25th, 2006, 10:54pm
 
that's a great idea only If I knew how to make a library in eclipse! I could leaqrn it, I am going to learn it but since this project is supposed to be finished by Tuesday, I am leaning towards more practical solutions.

Anyway here is what I did, I imported my processing core.lib file into my project and build a new class that extend PApplet and thaw works, so that I am thinking to draw the stuff here on Eclipse (I don't know if I can get away with that) I can draw shapes without problem but when it comes to font I tried to draw a font on the screen in eclipse and it simply didn;t work. It was first giving me the error of putting the font in a data folder error, that's what I did, I created a data folder in eclipse workspace and put my font in there, now it is not giving me that error but still giving me error while running the applet error.

So I am thinking this could be related to PFont class that is dealing with the font.

any thoughts?
(Also my project involves delicious API so creating a library and importing this  into processing would still work in this scheme?)
Thanks in advance!
ilteris.
Re: porting code from eclipse to processing
Reply #3 - Feb 26th, 2006, 3:23am
 
-- you can export a project from eclipse as a library /jar file ( it gives an option to export a project as a jar library; note: this i simply a zip archive )
-- the ´data folder error´ comes from the fact that processing uses data folder for files but it is relative to actual ´folder´ the sketch is run from ( correct me somebody pls if I am wrong )
so you would find out what is actual folder eclipse runs your program from ( can be also set in Run - Paramaters for an actual Run configuration in eclipse )
-- your delicious api is, in fact, a reason why you would deploy it as a library and use as such in processing since this functionality si not there...
regards,
aph
Page Index Toggle Pages: 1