← Back to arduino/Arduino

How to Deploy & Use arduino/Arduino

Arduino IDE 1.x Build and Deployment Guide

Version: 1.8.20 (Legacy)
Repository: arduino/Arduino
Language: Java (Swing)
Build System: Apache Ant

Deprecation Notice: This is the legacy Arduino IDE 1.x codebase, superseded by Arduino IDE 2.x. Use this guide only for maintenance or legacy hardware support.


1. Prerequisites

Required Tools

  • Java Development Kit (JDK) 8 or 11 (OpenJDK or Oracle JDK)
  • Apache Ant 1.10+
  • Git 2.0+
  • Python 3.6+ (for build scripts)

Platform-Specific Toolchains

The IDE requires embedded toolchains for compilation and uploading. These are downloaded automatically during the build process, but for development you may need:

Linux/macOS:

# AVR toolchain (required for most Arduino boards)
sudo apt-get install gcc-avr avr-libc avrdude  # Debian/Ubuntu
brew install avr-gcc avrdude                     # macOS

Windows:

  • Install WinAVR or use the Arduino IDE's bundled tools
  • Ensure make and sh are available (Git Bash or MSYS2 recommended)

Optional (for Packaging)

  • Windows: Inno Setup 6
  • macOS: appdmg (npm install -g appdmg) or Packages.app
  • Linux: dpkg-deb, rpmbuild

2. Installation

Clone Repository

git clone https://github.com/arduino/Arduino.git
cd Arduino

Verify Structure

Ensure the following directories exist:

Arduino/
├── app/              # IDE GUI source (Swing)
├── arduino-core/     # Core library and compiler interface
├── build/            # Ant build scripts (build.xml)
└── hardware/         # Hardware definitions (populated during build)

3. Configuration

Environment Variables

Set these if toolchains are not in default system paths:

# Linux/macOS
export ARDUINO_PATH=/path/to/Arduino
export AVR_GCC_PATH=/usr/local/avr-gcc/bin
export ARM_GCC_PATH=/usr/local/arm-none-eabi/bin

# Windows (PowerShell)
$env:ARDUINO_PATH="C:\path\to\Arduino"

Build Configuration

Edit build/build.xml if you need to:

  • Modify version numbers (default: 1.8.20, REVISION 10820)
  • Change download URLs for toolchains
  • Adjust memory settings for the JVM

Preferences (Runtime)

User preferences are stored in:

  • Linux: ~/.arduino15/preferences.txt
  • macOS: ~/Library/Arduino15/preferences.txt
  • Windows: %LOCALAPPDATA%\Arduino15\preferences.txt

Key settings for development:

editor.external=true
build.verbose=true
upload.verbose=true

4. Build & Run

Development Build

cd build

# Clean previous builds
ant clean

# Compile IDE and download cores/libraries
ant build

# Run development version
ant run

Build Outputs

After successful build:

  • Compiled classes: app/bin/ and arduino-core/bin/
  • Downloaded cores: hardware/ (AVR, SAM, etc.)
  • Libraries: libraries/

Testing

# Run unit tests
ant test

# Run specific test suite
ant test -Dtest.includes=processing.app.**.*

Production Build

# Create distribution packages for current platform
ant dist

# Build for specific platform
ant dist -Dplatform=linux
ant dist -Dplatform=macosx
ant dist -Dplatform=windows

Output locations:

  • Linux: linux/work/ (portable) and linux/arduino-1.8.20-linux*.tar.xz
  • macOS: macosx/work/Arduino.app and macosx/arduino-1.8.20-macosx*.zip
  • Windows: windows/work/ and windows/arduino-1.8.20-windows*.exe

5. Deployment

Desktop Distribution

Linux:

# Create .deb package (Debian/Ubuntu)
ant dist -Dplatform=linux64
# Output: linux/arduino-1.8.20-linux64.tar.xz

# Install manually
tar -xvf arduino-1.8.20-linux64.tar.xz -C /opt/
sudo /opt/arduino-1.8.20/install.sh  # Creates desktop entry

macOS:

ant dist -Dplatform=macosx
# Creates Arduino.app bundle
# Code sign for distribution:
codesign --deep --force --verify --verbose --sign "Developer ID" Arduino.app

Windows:

ant dist -Dplatform=windows
# Creates installer using Inno Setup (if installed)
# Or portable zip: arduino-1.8.20-windows.zip

Portable Installation

To create a portable version (settings stored in application folder):

  1. Build: ant dist
  2. Create portable folder inside the installation directory
  3. Settings will be stored in [install_dir]/portable/ instead of user home

6. Troubleshooting

Build Failures

Error: java.net.UnknownHostException during build

  • Cause: Cannot download toolchains or cores
  • Fix: Check internet connection or manually download from https://downloads.arduino.cc/ and place in build/linux/ (or macosx/windows)

Error: Unable to find a javac compiler

  • Cause: JDK not installed or JAVA_HOME not set
  • Fix:
    export JAVA_HOME=/usr/lib/jvm/java-11-openjdk  # Linux
    export JAVA_HOME=$(/usr/libexec/java_home)      # macOS
    

Error: class file has wrong version 55.0

  • Cause: Compiled with newer Java than runtime
  • Fix: Ensure JAVA_HOME points to JDK 8 or 11, not newer

Runtime Issues

Linux: Serial port '/dev/ttyACM0' not found

  • Fix: Add user to dialout group: sudo usermod -a -G dialout $USER

macOS: "Arduino" cannot be opened because the developer cannot be verified

  • Fix: Right-click app → Open, or run: xattr -cr Arduino.app

Windows: avrdude: ser_open(): can't open device

  • Fix: Install CH340/CP210x drivers; check COM port in Device Manager

Development Issues

Changes not reflecting after rebuild

ant clean
ant build

Missing cores/libraries in built IDE

  • Cores are downloaded to hardware/ during first build
  • If missing: ant download-cores or manually clone:
    git clone https://github.com/arduino/ArduinoCore-avr.git hardware/arduino/avr
    

OutOfMemoryError during compilation

  • Edit build/build.xml, increase memory in java task:
    <jvmarg value="-Xmx2048m"/>
    

Additional Resources