Build Arduino IDE From GIT Sources on Windows

by Erriez in Circuits > Arduino

7646 Views, 56 Favorites, 0 Comments

Build Arduino IDE From GIT Sources on Windows

ArduinoGithub.png

The purpose of this Instructable is to build the Arduino IDE from GIT on a clean Windows computer. The development master branch (mainline) will be used.

A Ubuntu Instructable is located here.

Prerequisites:

  • A clean Windows installation, 32 or 64 bit.
  • At least 2GB disk space.
  • Internet connection.

Let's start!

Download ANT

ExtractAnt.png

The first step is to download ANT which will be used to build the Arduino IDE Java source.


Download ANT from: https://ant.apache.org/bindownload.cgi.

Extract the apache-ant-1.9.7-bin.zip file, for example into your Download directory.
The results should be something like this:
Downloads\apache-ant-1.9.7\bin\ant.bat

Install Cygwin

CygwinSetup.png
CygwinPackages.png

Download Cygwin:

Double click on the setup to start the installation.

Select the following packages:

  • git
  • gcc++
  • make
  • perl
  • unzip

Start Cygwin from the Desktop.

Download and Install Java

JavaDownload.png
JavaInstallation.png
CheckJavaVersion.png

Java is required to run the Arduino IDE. This must be the 32 bit Java JDK, even if you're using Windows 64 bit.

Download Windows x86 Java SE Development Kit 8u101 from:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Double click on the jdk-8u101-windows-i586.exe setup to start the installation.
Click 3x Next > Close.

Open a Cygwin terminal and type:

# java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) Client VM (build 25.101-b13, mixed mode)

GIT Clone Arduino Source

gitClone.png

Download the latest Arduino sources from the GIT master branch with the git clone command:

$ cd /cygdrive/c/Users/$USER/Downloads
$ git clone https://github.com/arduino/Arduino.git


Next time you can update to the latest sources with the git pull command and skip the git clone:

$ git pull

Build Arduino IDE

Build.png

Now you're ready to build the Arduino IDE.

1. Set JAVA_HOME path:

  • Windows 32 bit:
$ export JAVA_HOME=/cygdrive/c/PROGRA~1/Java/jdk1.8.0_101
  • Windows 64 bit:
$ export JAVA_HOME=/cygdrive/c/PROGRA~2/Java/jdk1.8.0_101

2. Check the path JAVA_HOME environment variable:

$ ls $JAVA_HOME 

3. Set PATH environment variable:

$ export PATH="$JAVA_HOME/bin:$PATH" 

4. Go to the build directory in the Arduino GIT checkout:

$ cd Arduino/build/

5. Build the Arduino source:

$ ../../apache-ant-1.9.7/bin/ant.bat clean dist -Dplatform=windows
...
[input] Enter version number: [1.6.11] < [Enter]
...
# Be patient!
...
BUILD SUCCESSFUL
Total time: 1 minute 27 seconds

Run the Arduino IDE

CreateLink.png
ArduinoStarted.png

Create a shortcut on the desktop by holding down [CTRL+SHIFT] and drag arduino.exe to the Desktop.

Double click on the shortcut on the desktop to start the Arduino IDE.


Congratulations! You've successfully built the Arduino IDE from source!


Feel free to leave a comment with feedback or your success story. :-)

Thanks!