Getting started with contribution: How to build from source?

Hey! I want to build/run the source files given here: https://github.com/processing/processing.
However, the github wiki page seems to be under development: https://github.com/processing/processing/wiki/Build-Instructions . I’m looking for build commands, not sure if I need ant.

Many thanks,
Shikhar

1 Like

Yes, you need ant. Could you open a github ticket reporting this problem in the wiki page please?

Kf

Thanks!
Alright, I’ve opened an issue here: https://github.com/processing/processing/issues/5638

1 Like

It looks like a rogue had deleted the wiki page – but the instructions are now restored:

Build instructions:

I was recently building from source (it comes up for me every 2-3 years or so) and I did it using Docker so that I didn’t have to set up ant / jdk etc on my system. If you are familiar with Docker, this will work for you if you are trying to build a for Linux:

Build Processing on Linux in a Docker container

# Dockerfile for building Processing PDE on Linux using ant/jdk8
FROM frekele/ant:1.10.3-jdk8 AS buildenv
WORKDIR /root
RUN apt-get -y install git
# point at your altered fork here:
RUN git clone https://github.com/processing/processing.git --depth 1
WORKDIR /root/processing/build/
RUN ant clean
RUN ant build

Depending on what you want to do next, you can extend the Dockerfile to copy the build results out to a locally mounted volume – or copy them into another container, such as one running the app over a VNC or X11-hosted linux desktop. Here are two examples:

3 Likes

Fail: Build from Source described in https://github.com/processing/processing/wiki/Build-Instructions.
No error codes, now warnings, just no processing window open at the end.
Did show one of the jre-download:

     Header Name:null
     Header value:HTTP/1.1 404 Not Found

Suspect the Oracle “you need to log into your oracle account to download java” is not a match with your jre-download procedure in build.xml
The clue which suggests this is that after the ant run
the \myGitHubLocation\processing\build\jre\bin\ directory has only one ~7kb file named Downloader.class

My system:

Windows 7 pro, SP1
Oracle java downloaded today versions:  jdk1.8.0_211  and jre1.8.0_211
ant downloaded today:  version 1.10.6
ANT_HOME is set, 
JAVA_HOME is set to jdk
path has     %ANT_HOME%\bin;%JAVA_HOME%\bin;  
new command prompt window (post environment variable set) confirms   both 
     ant -version   
     java -version

Output from ant run is

Buildfile: C:\a_GitHub\processing\build\build.xml

run:

ignore-tools:
     [echo] Ignore the 'Unable to locate tools.jar' message.
     [echo] The tools.jar file is not required to build Processing.

revision-check:

windows-check-os:

jre-check:

downloader-setup:

compile:

dist:

jre-download:
[downloader] Redirecting to https://edelivery.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u202-windows-x64.tar.gz
[downloader] Redirecting to http://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u202-windows-x64.tar.gz?AuthParam=1559147309_1841c447d1cb984d09e29377057e36fa
[downloader] Redirecting to https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u202-windows-x64.tar.gz?AuthParam=1559147309_1841c447d1cb984d09e29377057e36fa
[downloader] Header Name:Accept-Ranges
[downloader] Header value:bytes
[downloader] 
[downloader] Header Name:null
[downloader] Header value:HTTP/1.1 404 Not Found
[downloader] 
[downloader] Header Name:Server
[downloader] Header value:AkamaiNetStorage
[downloader] 
[downloader] Header Name:ETag
[downloader] Header value:"477d9862374177c810b0b7d73b4f1e53:1531792454.541174"
[downloader] 
[downloader] Header Name:Connection
[downloader] Header value:keep-alive
[downloader] 
[downloader] Header Name:Last-Modified
[downloader] Header value:Wed, 31 Aug 2011 20:28:54 GMT
[downloader] 
[downloader] Header Name:Content-Length
[downloader] Header value:7073
[downloader] 
[downloader] Header Name:Date
[downloader] Header value:Wed, 29 May 2019 16:26:29 GMT
[downloader] 
[downloader] Header Name:Content-Type
[downloader] Header value:text/html
[downloader] 

Workarounds tried/failed.

  1. Copied the jre1.8.0_211 directory into the \myGitHubLocation\processing\build\jre directory
    and changed the build.xml variable to match:
    property name=“jdk.update” value=“211” /
  2. Copied the jdk1.8.0_211 directory into \myGitHubLocation\processing\build\jre
1 Like

You might want to open this as an issue if you have not already, and post the issue link here

Did open as an issue. link is:
Build from Source fails. Seems to not acquire oracle java

1 Like

Try workaround suggested in https://github.com/processing/processing/issues/5860

Kf

Hi!
I’ve been trying to build the IDE. I get this error on executing

ant run
Buildfile: /home/svr8/Desktop/Code/forked/processing/build/build.xml

run:

ignore-tools:
     [echo] Ignore the 'Unable to locate tools.jar' message.
     [echo] The tools.jar file is not required to build Processing.

check-linux-arm32:

check-linux-arm64:

revision-check:

linux-check-os:

jre-check:

downloader-setup:

compile:

dist:

jre-download:
[downloader] Redirecting to https://edelivery.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u202-linux-x64.tar.gz
[downloader] Redirecting to http://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u202-linux-x64.tar.gz?AuthParam=1560284548_0274da5e9b581874b5df5d5e7855cfbf
[downloader] Redirecting to https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u202-linux-x64.tar.gz?AuthParam=1560284548_0274da5e9b581874b5df5d5e7855cfbf
[downloader] Header Name:Accept-Ranges
[downloader] Header value:bytes
[downloader] 
[downloader] Header Name:null
[downloader] Header value:HTTP/1.1 404 Not Found
[downloader] 
[downloader] Header Name:Server
[downloader] Header value:AkamaiNetStorage
[downloader] 
[downloader] Header Name:ETag
[downloader] Header value:"477d9862374177c810b0b7d73b4f1e53:1531792454.541174"
[downloader] 
[downloader] Header Name:Connection
[downloader] Header value:keep-alive
[downloader] 
[downloader] Header Name:Last-Modified
[downloader] Header value:Wed, 31 Aug 2011 20:28:54 GMT
[downloader] 
[downloader] Header Name:Content-Length
[downloader] Header value:7073
[downloader] 
[downloader] Header Name:Date
[downloader] Header value:Tue, 11 Jun 2019 20:20:32 GMT
[downloader] 
[downloader] Header Name:Content-Type
[downloader] Header value:text/html
[downloader]

java -version
java version "1.8.0_202" Java(TM) SE Runtime Environment (build 1.8.0_202-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

javac -version
javac 1.8.0_202

ant -version
Apache Ant(TM) version 1.10.5 compiled on March 28 2019

OS
Ubuntu 19.04

You said you get an error message. Was it just the [downloader] log? I don’t see an error.

Oh right! No errors but I’m can’t understand what’s happening exactly. Earlier, after the downloads, the ide used to start.

If your OS in Windows, go to your local Processing repo, build your repo and then go inside the build\Windows folder. Can you find the PDE executable there? I understand the PDE should execute at the end of the build and it is not happening in your case. Note the build instructions were updated recently. Not sure if the build file was modified in this update. Can you confirm you are downloading the latest copy of the Processing code from the repo?

Kf

1 Like

I have forked the repository again recently and cloned it. It is the latest version.
I am in Linux (Ubuntu 19.04). Is there anyway to check on Linux? These are the files in the /build/linux:
appdata.xml desktop.template processing.desktop uninstall.sh control install.sh processing-pde.xml copyright processing processing.sharedmimeinfo

My Windows partition on the system is not setup with Java and other tools yet. I’ll try it on windows soon.

I do not have Linux so I cannot test this unfortunately. From the files you listed in your /build/linux, I can see you have processing. OYu should be able to execute it manually from the terminal. Go to that folder and run ./processing. Does it launch? If you get an error, please copy and paste it here and if possible, get a screenshot.

Also, please provide your java -version and ant -version output if you haven’t done so.

Kf

On executing ./processing as mentioned, error:
Error: Could not find or load main class processing.app.Base

java -version
java version "1.8.0_202" Java(TM) SE Runtime Environment (build 1.8.0_202-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

javac -version
javac 1.8.0_202

ant -version
Apache Ant(TM) version 1.10.5 compiled on March 28 2019

OS
Ubuntu 19.04

Do you know about this problem? Ben Fry recently updated the build instructions to address a download problem from oracle but it seems the solution is not working in Linux. I do not know the details of the changes in the source code or maybe there was no changes at all. His instructions explicitly state to use Java 1.8_0_202 which is what you are using.

Did you try the workaround in my previous post? Also, can you confirm you are using the latest version of the master branch from Github when you were doing these builds?

Kf

I am using Windows now. Yes, i have checked my forked repository and local repository. Both are sync and up-to-date with latest version of master branch of original repository(on both systems, Windows and Linux).
Still facing the same problem.

For the workaround:

  • I downloaded the jre-212 version as suggested, moved and renamed the file.
    This is the file structure of
\processing\build\windows

06/19/2019  07:12 PM    <DIR>          .
06/19/2019  07:12 PM    <DIR>          ..
06/19/2019  06:29 PM                11 .gitignore
06/19/2019  06:29 PM           507,656 about.bmp
06/19/2019  06:29 PM            85,884 application.ico
06/19/2019  06:29 PM             2,159 config-cmd.xml
06/19/2019  06:29 PM             3,058 config.xml
06/19/2019  06:56 PM        78,699,948 jre-8u212.tar
06/19/2019  06:29 PM               168 processing.bat
               7 File(s)     79,298,884 bytes
               2 Dir(s)   8,967,671,808 bytes free
  • Next, I updated the property jdk.update to from 202 to 212.
  • Now in the processing\windows directory, I executed ant build. It gave this output:
processing\build>ant build

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.0_202\lib\tools.jar
Buildfile: C:\Users\svr8s\Desktop\Code\forked\processing\build\build.xml

build:

ignore-tools:
     [echo] Ignore the 'Unable to locate tools.jar' message.
     [echo] The tools.jar file is not required to build Processing.

revision-check:

windows-check-os:

jre-check:

downloader-setup:

compile:

dist:

jre-download:
[downloader] Redirecting to https://edelivery.oracle.com/otn-pub/java/jdk/8u212-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u212-windows-x64.tar.gz
[downloader] Redirecting to http://download.oracle.com/otn-pub/java/jdk/8u212-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u212-windows-x64.tar.gz?AuthParam=1560952080_104e23482c35b1e0cc03113bdc56cc44
[downloader] Redirecting to https://download.oracle.com/otn-pub/java/jdk/8u212-b08/1961070e4c9b4e26a04e7f5a083f551e/jre-8u212-windows-x64.tar.gz?AuthParam=1560952080_104e23482c35b1e0cc03113bdc56cc44
[downloader] Header Name:Accept-Ranges
[downloader] Header value:bytes
[downloader]
[downloader] Header Name:null
[downloader] Header value:HTTP/1.1 404 Not Found
[downloader]
[downloader] Header Name:Server
[downloader] Header value:AkamaiNetStorage
[downloader]
[downloader] Header Name:ETag
[downloader] Header value:"477d9862374177c810b0b7d73b4f1e53:1531792454.541174"
[downloader]
[downloader] Header Name:Connection
[downloader] Header value:keep-alive
[downloader]
[downloader] Header Name:Last-Modified
[downloader] Header value:Wed, 31 Aug 2011 20:28:54 GMT
[downloader]
[downloader] Header Name:Content-Length
[downloader] Header value:7073
[downloader]
[downloader] Header Name:Date
[downloader] Header value:Wed, 19 Jun 2019 13:46:03 GMT
[downloader]
[downloader] Header Name:Content-Type
[downloader] Header value:text/html
[downloader]

The IDE did not start.
Please tell me if made a mistake in the workaround.

System Details:

ant -version

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.8.0_202\lib\tools.jar
Apache Ant(TM) version 1.9.14 compiled on March 12 2019 

java -version

java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
1 Like

This is not enough:

Then I did the steps I mentioned above: edit the build file to update the java version and the build value plus rename the zip jdk file and copied it to the proper location

This is the tricky part: the java version has a jdk vlaue and a build value. This information is avaialble when you download the sdk from Oracle and I am guessing it depends on OS so Linux and Windows OS’s will have different values.

You can see this in the source file here. These are the values I am using currently when building.

As soon as you get the right values and if you have the right java jdk, then the ant build will skip downloading the jdk from Oracle and you will not have this error anymore.

Kf

2 Likes

It works!
After moving the 212 version, I had updated system Java version to 212. After resetting it back to 202, it worked.

Thank you for all the help!

1 Like