Introduction: Build Arduino IDE From GIT Sources on Ubuntu 16.04

Picture of Build Arduino IDE From GIT Sources on Ubuntu 16.04

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

A Windows Instructable is located here.

Prerequisites:

  • A clean Ubuntu installation (Tested on Ubuntu 16.04 32 and 64 bit)
  • At least 1GB disk space.
  • Internet connection.

Let's start!

Step 1: Install Java

Picture of Install Java

The first step is to install Java which is required to run the Arduino IDE.

1. Open a terminal. (CTRL+ALT+T)

Note: Copy and paste the commands below without the $ character into the terminal and press [Enter]):

2. Add the following PPA (Personal Package Archives) to install Oracle Java 8 which includes JDK8 and JRE8:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
Note: You should accept the license agreement by selecting: Yes:
[LEFT ARROW], [Enter]

3. Check the Java installation, for example:

$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Step 2: Install Ubuntu Development Tools

Picture of Install Ubuntu Development Tools

Install the following development packages:

$ sudo apt-get install ant gcc git make

Step 3: GIT Clone Arduino Source

Picture of GIT Clone Arduino Source

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

$ cd ~/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

Step 4: Build Arduino Sources

Picture of Build Arduino Sources

Build the sources:

$ cd Arduino/build
$ ant dist
...
[input] Enter version number: [1.6.11] < Press [Enter]
...
# Be patient!
...
BUILD SUCCESSFUL Total time: 9 minutes 10 seconds

Step 5: Install Arduino

Create the following directory:

$ mkdir -p /home/$USER/.local/share/icons/hicolor/

Install Arduino:

$ cd linux/work/
$ ./install.sh

Optional:

Create a symbolic link for Arduino tools:

$ sudo ln -s /home/$USER/Downloads/Arduino/build/linux/work/arduino /usr/local/share/arduino-master
$ ls -la /usr/local/share/arduino-master
lrwxrwxrwx 1 root root 54 aug 10 22:51 /usr/local/share/arduino-master -> /home/erwin/Downloads/Arduino/build/linux/work/arduino

Step 6: Run the Arduino IDE

Picture of Run the Arduino IDE

Double click on the Arduino IDE shortcut on the desktop.

Congratulations! Arduino mainline is now installed!

Comments

dhotrum1 (author)2016-12-24

ok, build failed!! what did I do wrong?

dave@David-pc:~/Downloads/Arduino/build$ ant dist
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar
Buildfile: /home/dave/Downloads/Arduino/build/build.xml

revision-check:
[echo] AVR Arduino core version in platform.txt is: 1.6.16
[echo] latest in package_index_bundled.json is: 1.6.16
[echo] Latest revision detected in shared/revision.txt is: 1.8.1
[echo] Revision in BaseNoGui.java is: 1.8.1

dist:
[input] Enter version number: [1.8.1]


build:

revision-check:
[echo] AVR Arduino core version in platform.txt is: 1.6.16
[echo] latest in package_index_bundled.json is: 1.6.16
[echo] Latest revision detected in shared/revision.txt is: 1.8.1
[echo] Revision in BaseNoGui.java is: 1.8.1

linux-checkos:

subprojects-build:

compile:
[mkdir] Created dir: /home/dave/Downloads/Arduino/arduino-core/bin

BUILD FAILED
/home/dave/Downloads/Arduino/build/build.xml:126: The following error occurred while executing this line:
/home/dave/Downloads/Arduino/build/build.xml:103: The following error occurred while executing this line:
/home/dave/Downloads/Arduino/build/build.xml:150: The following error occurred while executing this line:
/home/dave/Downloads/Arduino/arduino-core/build.xml:41: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-8-openjdk-amd64/jre"

Total time: 1 minute 16 seconds
dave@David-pc:~/Downloads/Arduino/build$

julyjim (author)2016-09-02

Can you elaborate on "git pull"? I have lost my code and just trying to rebuild it , so I tryied "git pull" and got this . I must be missing something here.

fatal: Not a git repository (or any of the parent directories): .git

Erriez (author)julyjim2016-09-02

I suggest you to run the "git clone" command again, because your hidden .git directory is probably missing. Then you can run "git pull" again.

Success!

About This Instructable

1,356views

14favorites

More by Erriez:USB pedal HID keyboard with Arduino LeonardoDupont crimp tool tutorialBuild Arduino IDE from GIT sources on Windows
Add instructable to: