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.
Page Index Toggle Pages: 1
Building Processing on Windows (Read 1419 times)
Building Processing on Windows
Jan 2nd, 2009, 6:10pm
 
I voluntarily reduce the scope of this thread because I plan to explain only my experience (but others are welcome!) which is for one system only. But some tips here might work on other platforms...

For some time, I just didn't attempted to build Processing, because I was a bit "scared" by the instructions to build Processing (using make, shell scripts, what's not).  For some old irrational reasons, I prefer to avoid installing/using Cygwin.
But this forum being a bit quiet, I decided to give a go. I chose to (mostly) ignore them build instructions Smiley, and to reduce my ambition: after all, I don't plan to do a full distribution, but just to be able to re-create core.jar and pde.jar, and of course to modify them later.

I checked out the code with SVN, and I imported two Eclipse projects I found there, the core and the app. I might look later at the libraries.

I fumbled a bit with the imports (manually copying the jars at the right place1, pointing to JDK's tools.jar), managed to get the incantations to run Antlr (I copied/adapted the lines from the .sh file to a .bat file) and I got rid of the red signs in the Eclipse projects...

After zipping the bin folders (I found that the P5 jars are just zips, not "true" jars made with Sun's jar tool with manifest and all), and replacing core.jar and pde.jar, I could run PDE and a random sketch, so it looks OK. The class files are slightly bigger, perhaps because I don't use something like ProGuard.

Here are the little batch lines I used in the process:

PreProc.bat

Code:
REM Based on some shell script...
REM I assume JAVA_HOME is correctly set. Can be set here too. Or remove java.exe's path if it is already in the PATH.
REM This file must be at the root, so the %~dp0 (path of the batch file) is equals to the processing SVN root.
%JAVA_HOME%/bin/java.exe -cp "build/shared/lib/antlr.jar" antlr.Tool -o app/src/antlr/java app/src/antlr/java/java.g
copy app\src\antlr\java\JavaTokenTypes.txt app\src\processing\app\preproc\JavaTokenTypes.txt
cd app/src/processing/app/preproc
%JAVA_HOME%/bin/java.exe -cp "%~dp0/build/shared/lib/antlr.jar" antlr.Tool -glib %~dp0/app/src/antlr/java/java.g pde.g
REM Baby come back!
cd %~dp0


ZipJar.bat
Code:
cd app/bin
"C:\Program Files\_Sys\7-Zip\7z.exe" a -r -tzip D:\Dev\processing\pde.jar *.class
cd ../../core/bin
"C:\Program Files\_Sys\7-Zip\7z.exe" a -r -tzip D:\Dev\processing\core.jar *.class
cd ../..

I used 7-Zip just because I have it handy, you can use InfoZip or another other tool actually.
Also it is primitive, including everything (linux and mac specific code).

1 From processing\app\lib to processing\build\shared\lib - don't ask me why I just didn't change the path to jars in the project... Smiley

I hope these simple (?) instructions will give will to experimented Java developers to try and add missing features (or improve existing ones)...
Don't hesitate to ask if something is obscure.
Page Index Toggle Pages: 1