Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and

Friday, 24 May 2013

How to customise the processing-2.0 build

Recently I was interested in compiling processing with the latest Oracle jdk7, so I created this custom build7.xml master build script, well actually here are the lines that need changing. The important inclusion antfile="build7.xml" is required to specify the sub-build build files
138   <target name="subprojects-build">
139     <subant buildpath="../core" antfile="build7.xml" target="build"/>
140     <subant buildpath="../app" antfile="build7.xml" target="build"/>
This now targets my custom sub-build scripts build7.xml in place of the default build.xml scripts in the sub-build folders. Here the only change required is to remove the source and target parameters, so the build defaults to current java "level".
To achieve the jdk7 build I used my custom ant7 script, that sets JAVA_HOME to match the required jdk home:-
   1 #!/usr/bin/env sh
   2 export JAVA_HOME=/opt/jdk1.7.0_21
   3 export ANT_HOME=/opt/apache-ant-1.9.0
   4 export PATH=${PATH}:${ANT_HOME}/bin
   5 ${ANT_HOME}/bin/ant $@
Worked for me, then at runtime if you replace the included java runtime with a symbolic link to the jdk, you can then running processing as though it had been build to run with java 7. Actually this also actually works using openjdk1.7.0_21 but you will then get a warning dialog box that you can ignore (nothing bad happens). As the app when built with jdk7 wont actually run with provided java-6 runtime it is best to just do linux-dist build (then provide the jdk [including required tools] via a symbolic link replacing the java folder (contains java-6 run time with tools). Don't do symbolic link in-situ in your cloned processing as you will either clobber your jdk when you do ant clean (ant tries to recursively delete the jdk v. bad) or you will not be able to delete files (you could just delete the link yourself but ant ain't that clever...).


Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby- and processing-3.2.2