Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
per1234 edited this pageMar 10, 2023 ·60 revisions

Steps for First Time Setup

1. Install Development Tools

Windows

On Windows, you'll need Cygwin, a Java JDK, and ant.

Cygwin is downloadable fromhttp://www.cygwin.com/ or specifically:http://www.cygwin.com/setup-x86.exe (32-bit windows) orhttp://www.cygwin.com/setup-x86_64.exe (64-bit windows) orhttp://www.redhat.com/services/custom/cygwin/ (if the Cygwin official site is not OK for us!)

In the Cygwin setup configuration select the packages:

  • git - used for version control
  • make, mingw64-x86_64-gcc-g++ - used to build arduino.exe (this will also pull in mingw64-x86_64-gcc-core)
  • perl - use this version, activestate or other distros have trouble
  • unzip, zip - for dealing with archives

Included in the defaults, but make sure:

  • coreutils (or textutils), gzip, tar

Not required but useful:

  • openssh - command line ssh client
  • nano - handy/simple text editor

When the Cygwin setup says it cannot find all packages, clicking "previous" and "next" again will automatically select some additional required packages and often resolves this issue.

Download and installant. Add theapache-ant-xxx\bin directory to your path. Ensure that the path to theapache-ant-xxx directory does not contain quotes (either ' or ") for reasons mentionedhere.

Download and install a Java JDK.

Point theJAVA_HOME environment variable to the JDK root directory. An error message that reads "Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar" means you need to set JAVA_HOME to your JDK (not JRE) installation.

When building on a 64 bit version of Windows, you must still use the 32 bit JDK. If you have both the 32 and 64 bit JDK's installed, ensureJAVA_HOME is set to the 32 bit version.

Mac OS X

On Mac OS X (usingHomebrew, firstbrew update), install:

  • Apple's Developer Tools
  • git (brew install git)
  • JDK 8
    brew tap homebrew/cask-versionsbrew cask install adoptopenjdk8
  • if you also have JDK 9 or 10 installed, you will need to select JDK 8 with (adjust jdk1.8.0_181.jdk to match the installed version).
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
  • ant (brew install ant)

Linux

On Linux, you need the Java SDK, avr-gcc, avr-g++, avr-libc, make, ant, git and unzip.

Ubuntu/Debian/Mint

sudo apt-get install git make gcc ant openjdk-8-jdk unzip

If your Linux version is Ubuntu 14.04 and later, you can use the above command line.If not, use the info athttp://ubuntuhandbook.org/index.php/2015/01/install-openjdk-8-ubuntu-14-04-12-04-lts/

You may also need the openjfx library to build version 1.8.8:

sudo apt-get install openjfx

Arch Linux

sudo pacman -S jdk8-openjdk jre8-openjdk apache-ant git base-devel

CentOS 7 Linux

Check if present thus:
rpm -qa --qf"%{name}\n" git make gcc xz-lzma-compat ant\*openjdk\*| sort
antgccgitjava-1.8.0-openjdkjava-1.8.0-openjdk-develjava-1.8.0-openjdk-headlessxz-lzma-compatmake
and install any packages needed, thus:
sudo yum -y install make gcc ant xz-lzma-compat java-1.8.0-openjdk

N.B.: 'ant' pulls in the '-devel' version of 'java-1.8.0-openjdk' which is expected

2. Build from Source

This grabs the code from GitHub as an anonymous user.

Make sure your git line ending settingautocrlf is set toinput orfalse. Withtrue building will fail.You can see/change this setting with:

git config --global --edit[user]name = xxxemail = xxx@users.noreply.github.com[core]autocrlf = input[push]default = current

Grab the code

git clone --depth 1 https://github.com/arduino/Arduino.git

(Note: This only pulls the latest commit to make the download faster. The download size of the entire repository is greater than 1GB and might hog all your bandwidth for a long while if your download speed is slow, such as a dialup connection or anything below 8mbps.)

Build it

Use the command line:

(Note: cd the path to build folder. Do not copy what is written next to the cd below.)

cd /path/to/arduino/buildant dist

This will prompt you to enter an Arduino version to build (the latest development version will be listed in the prompt, i.e. 1.8.13) before it starts the build.

If everything went well, you'll have no errors.(Feel free to make edits of things to include here for common problems.)

Run it

ant run

(ant run will callbuild andstart)

Each time you make a change, useant dist to build the thing andant run to get it up and running.

Updating to the Latest Version

Each time you want to update to latest version from git use:

cd /path/to/arduinogit pull

If new folders have been added, or you're getting odd errors, use:

ant clean

The best way to use it is to just make a clean build every time:

ant clean build start

If you want to debug the avr core you can put a symlink from your sketchbook to your git folder. This way you can directly commit the changes without copying back and forth.

ln -s ~/Documents/Arduino/Arduino/hardware/arduino/avr/ ~/Documents/Arduino/sketchbook/hardware/arduino/avr

Build for other platforms

You can do the build for other platforms using:

ant clean dist -Dplatform=windowsant clean dist -Dplatform=macosxant clean dist -Dplatform=macosx-java-latest
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp