-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Build Instructions
If you have questions about the contents of this document, ask them in the forum.
Let's try the easy route first:
-
Install Java 7
-
On Windows and Linux, install the latest JRE 7 from Oracle.
-
On Mac OS X, download and install JDK 7.
-
Install Apache Ant per its instructions.
-
On Mac OS X, you can install Xcode instead, since ant is included (see below).
-
Ant 1.8 or later is required.
-
Clone the processing git repository.
-
On the command line,
git clone https://github.com/processing/processing.git
-
From a GUI client, the URL is
https://github.com/processing/processing.git
. Git for Windows or Git for Mac should work, however these aren't tested and we only use the command line for development. -
When building for the first time on Windows and Linux, you'll need to have an internet connection, because additional files need to be downloaded.
-
Open a terminal/console/command prompt, change to the directory where you cloned Processing, and type:
cd build
ant run
With any luck, there will be all sorts of console spew for a few moments, followed by a Processing window showing up. Hooray!
To get the latest updates, just run git pull
from the command line (or GUI client) and repeat the two lines above.
Oh well, here are more details for what may have gone wrong.
-
Make sure that
java
is available. From any terminal/console/command prompt, and typejava
and see what happens. If it says something likecommand not found
, then it may be the case that -
Java may not be installed (did you really skip the first line of the instructions above?)
-
The wrong version of Java is installed (32-bit instead of 64-bit, or vice-versa)
-
The
java
command is not in your system's PATH. -
Computers don't like you.
-
Make sure that
ant
is available. Do the same steps as withjava
, above. -
When running ant, the warnings about JAVA_HOME not being set can be ignored. It's not necessary to set JAVA_HOME to build Processing. (Before Processing 2.1, it was necessary. No longer.)
Some additional notes for other platforms follow:
- The Mac build requires a specific version of the Java update. As I write this, it's 7u45. This will be updated over time, but if you're using a later version of Java and it's not been updated in the Processing source, you may need to manually change the setting inside build.xml. It reads like this:
<property name="jdk.update.macosx" value="45" />
You can change that value to something higher than 45 if that's what you're using (though keep in mind that there may be incompatibilities).
- Java 7u40 is the first version that works with Processing. Earlier versions of Java 7 were complete garbage, and will not work properly.
- Apple's Java 6 no longer works, and the full JDK 7 is required (unlike Windows or Linux, where a JRE is enough).
- Installing Xcode is recommended. After installing Xcode, be sure to add the command line tools. This is in Preferences → Downloads → Command Line Tools.
- We use a modified version of Oracle's appbundler project to bundle the Processing application (and as a skeleton for exported applications). You can browse the code here.
- The appbundler.jar file created by that build process is included in the Processing source, so that it's not necessary to have a full Xcode tools installation just to build Processing.
- To build appbundler, you'll need a full Xcode installation as described above. You'll also need the OS X 10.8 SDK installed so that the necessary header files are present. (Older or newer versions will not work.)
- As of Processing 2.1, a full JDK is no longer required on Windows. Only the JRE is necessary.
- The trickiest thing on Windows is usually adding
ant
to the PATH and installing the right 32-bit or 64-bit Java that will work from the Command Prompt or whatever shell you're using. See above.
- As of Processing 2.1, a full JDK is no longer required on Linux. Just the JRE.
- Use Oracle's Java. We don't test with OpenJDK, and over the years it has been unlikely to work. Please just download the version of Java from Oracle. You may think that Oracle is evil incarnate and that the name is an acronym for “One Rich Asshole Called Larry Ellison”. However, this saves me time because you won't be filing bugs about OpenJDK quirks breaking the build or Processing itself.
- No guarantee is made about the stability of the source on Github. Because almost all development is done by one or two people, we don't spend any time making changes in branches or attempting to keep the source stable.
Disclaimer: Processing is intended to be built with ant from the command line. Using Eclipse isn't fully supported and may break from time-to-time. You should always ensure the code compiles with ant before submitting a pull request.
-
Open Eclipse, select File → Import... Expand the “Git” folder, select “Projects from Git”, and hit the Next button.
-
On the “Select Repository Source” screen, choose “URI” and enter https://github.com/processing/processing.git And then click Next.
-
Select “Import existing projects” on the “Wizard for project import” page. Hit Next.
-
Select all the projects shown and finish the wizard.
-
You'll have several errors, because you need to build the projects once with ant (on the command line: cd /path/to/processing/build && ant) so that the “generated” folder is created. After doing that, select the processing-app project in Eclipse and hit F5 to refresh it.
-
Use Run as Application to start processing/app/Base.java, and you should be in business.
-
You'll need to set an ANDROID_LIB classpath variable (Preferences → Java → Build Path → Classpath Variables), that points at the android.jar file for SDK 10. i.e. /path/to/android-sdk/platforms/android-10/android.jar
-
For bonus points, you can also set
processing/build/formatter.xml
as the code formatter for your workspace. -
Be sure to the execution environment is set to Java 1.6, since that's what's used for the PDE. Java 7 code is used inside appbundler, but for the moment, nowhere else.
-
Make sure your working directory is set to
processing/build/<platform>/work
if you want to run Processing from Eclipse for debugging.