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 & HelpOther Libraries › ControlP5 recompiling
Page Index Toggle Pages: 1
ControlP5 recompiling (Read 1305 times)
ControlP5 recompiling
Feb 27th, 2009, 2:59am
 
Hi !
I have been trying to recompile the Controller.java class of ControlP5 to include a new set3dPosition function. The goal is to be able to set the z coordinate to move a text in a 3D space. However I have a lot of trouble trying to recompile the file and update the jar file. How can we do this easily ? It seems not to recognize the processing classes, and the other classes of controlP5, even if i put the classpaths... how do we handle that please ?
Re: ControlP5 recompiling
Reply #1 - Feb 27th, 2009, 11:07am
 
hi, the following works for me on osx.
you can checkout the svn repository of controlP5. after downloading a copy of the current version of controlP5:

ANT-COMPILE
navigate to folder sojamop5/trunk
in there you will find folder buildFiles which contains an ant file called buildControlP5.xml
navigate back to trunk, create a folder libs and put a copy of core.jar (the core sources of processing) in there

go to trunk/buildFiles and use the following command from your command line:
Code:

ant -f buildControlP5.xml

your compiled controlP5.jar file will be located in
trunk/tmp/controlP5/library/controlP5.jar

JAVAC-COMPILE
(the command line below applies to osx, when using windows, the : as classpath separator has to change to ; )
navigate to folder sojamop5/trunk
in your command line tool execute the following commands. make sure folder trunk/tmp and folder trunk/tmp/build exists. then proceed with the following
Code:

javac -classpath "./src/controlP5:./libs/core.jar" -d ./tmp/build ./src/controlP5/*.java ; cp src/controlP5/*.gif tmp/build/controlP5 ; cd tmp/build ; jar cf controlP5.jar controlP5

the controlP5.jar will be located in trunk/build

hope this helps. the ANT-COMPILE version should be the preferred way to compile controlP5. i do use the buildFast.xml ant-file from within eclipse though to compile controlP5.

best,
andreas




Re: ControlP5 recompiling
Reply #2 - Mar 1st, 2009, 11:16pm
 
Thanks a lot for taking the time to help me out. I'm completely new to the concept of svn repository though. I installed tortoiseSVN and I wasn't able to create a folder libs on the server because it asked me for a login / pass I don't have.

However I did manage to get a copy of the whole trunk file. Then, locally, I made a change of the Controller.java file, then created the libs folder and put the core.jar processing file there.

Then I created the tmp/ and tmp/build/ folders. I don't have my own server so I excluded the ant compilation. I did the javac though. Turns out I have the same 100 errors I had before while I try the first :

javac -classpath "./src/controlP5:./libs/core.jar" -d ./tmp/build ./src/controlP5/*.java on the command line

errors include :

"cannot find symbol"(class PApplet)

and

".\src\controlP5\Label.java:198: operator + cannot be applied to <nulltype>,int theApplet.rect(position.x, position.y, _myImage.width +_myControllerStyle.paddingRight"

any clues ?
Re: ControlP5 recompiling
Reply #3 - Mar 2nd, 2009, 9:44am
 
since you are on windows, the classpath separator has to change from : to ; (i modified my earlier post accordingly)
-classpath "./src/controlP5;./libs/core.jar"

hope this solves the problem.
best,
andreas
Re: ControlP5 recompiling
Reply #4 - Mar 2nd, 2009, 8:50pm
 
Almost !!

Thanks to you I succeeded in building the jar file. It was because of the ; !!! However the cp command couldn't be recognized. I supposed this meant "copy all the gifs from source controlP5 to tmp controlP5 so I did it manually and the images were in the folder along with the class files before building the jar.

But when I replace your controlP5 jar by mine I get this error :

Uncaught error fetching image: java.lang.NullPointerException at sun.awt.image.URLImageSource.getConnection (URLImageSource.java:99)[...]

Do you know why ?
Re: ControlP5 recompiling
Reply #5 - Mar 3rd, 2009, 1:09pm
 
you get this error, because the gif files are not included in controlP5.jar. i am not sure what the windows equivalent to cp (copy files) is, so i use the manual copy procedure in the example below.

Code:

javac -classpath "./src/controlP5:./libs/core.jar" -d ./tmp/build ./src/controlP5/*.java ;


copy the .gif (with 0.3.14 there are 4 gif images in src) files manually into tmp/build/controlP5 then continue with.

Code:

cd tmp/build ; jar cf controlP5.jar controlP5


works for me.
Re: ControlP5 recompiling
Reply #6 - Aug 15th, 2009, 12:15pm
 
I just fetched the most recent version from the svn repository and had some trouble building. The ant file buildControlP5.xml did not work for me: while everything compiled okay, I think there was some kind of namespace error or something, because when I copied the resultant jar into my Processing libraries directory, I would get a "does not exist error" when trying to load it up in a sketch.

When I ran buildFast.xml from Eclipse, however, everything worked fine.
Page Index Toggle Pages: 1