]> git.donarmstrong.com Git - qmk_firmware.git/blob - Eclipse.md
Instruct to use the Eclipse installer instead of extracting the package, describe...
[qmk_firmware.git] / Eclipse.md
1 [Eclipse](https://en.wikipedia.org/wiki/Eclipse_(software)) is an open-source [Integrated Development Environment](https://en.wikipedia.org/wiki/Integrated_development_environment) (IDE) widely used for Java development, but with an extensible plugin system that allows to customize it for other languages and usages.
2
3 Using an IDE such as Eclipse provides many advantages over a plain text editor, such as:
4 * intelligent code completion
5 * convenient navigation in the code
6 * refactoring tools
7 * build automation (no need for the command-line)
8 * a GUI for GIT
9 * static code analysis
10 * many other tools such as debugging, code formatting, showing call hierarchies etc.
11
12 The purpose of the is page is to document how to set-up Eclipse for developing AVR software, and working on the QMK code base.
13
14 Note that this set-up has been tested on Ubuntu 16.04 only for the moment.
15
16 # Prerequisites
17 ## Build environment
18 Before starting, you must have followed the [Getting Started](../#getting-started) section corresponding to your system. In particular, you must have been able to build the firmware with [the `make` command](../#the-make-command).
19
20 ## Java
21 Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.
22
23 # Install Eclipse and its plugins
24 Eclipse comes in [several flavours](http://www.eclipse.org/downloads/eclipse-packages/) depending on the target usage that you will have. There is no package comprising the AVR stack, so we will need to start from Eclipse CDT (C/C++ Development Tooling) and install the necessary plugins.
25
26 ## Download and install Eclipse CDT
27 If you already have Eclipse CDT on your system, you can skip this step. However it is advised to keep it up-to-date for better support.
28
29 If you have another Eclipse package installed, it is normally possible to [install the CDT plugin over it](https://eclipse.org/cdt/downloads.php). However it is probably better to reinstall it from scratch to keep it light and avoid the clutter of tools that you don't need for the projects you will be working on.
30
31 Installation is very simple: follow the [5 Steps to Install Eclipse](https://eclipse.org/downloads/eclipse-packages/?show_instructions=TRUE), and choose **Eclipse IDE for C/C++ Developers** at Step 3.
32
33 Alternatively, you can also directly [download Eclipse IDE for C/C++ Developers](http://www.eclipse.org/downloads/eclipse-packages/) ([direct link to current version](http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/neonr)) and extract the package to the location of your choice (this creates an `eclipse` folder).
34
35 ## First Launch
36 When installation is complete, click the <kbd>Launch</kbd> button. (If you extracted the package manually, open the Eclipse installation folder and double-click the `eclipse` executable)
37
38 When you are prompted with the Workspace Selector, select a directory that will hold Eclipse metadata and usually your projects. **Do not select the `qmk_firmware` directory**, this will be the project directory. Select the parent folder instead, or another (preferably empty) folder of your choice (the default is fine if you do not use it yet).
39
40 Once started, click the <kbd>Workbench</kbd> button at the top right to switch to the workbench view (there is a also checkbox at the bottom to skip the welcome screen at startup).
41
42 ## Install the necessary plugins
43 Note: you do not need to restart Eclipse after installing each plugin. Simply restart once all plugins are installed.
44
45 ### [The AVR plugin](http://avr-eclipse.sourceforge.net/)
46 This is the most important plugin as it will allow Eclipse to _understand_ AVR C code. Follow [the instructions for using the update site](http://avr-eclipse.sourceforge.net/wiki/index.php/Plugin_Download#Update_Site), and agree with the security warning for unsigned content.
47
48 ### [ANSI Escape in Console](https://marketplace.eclipse.org/content/ansi-escape-console)
49 This plugin is necessary to properly display the colored build output generated by the QMK makefile.
50
51 1. Open <kbd><kbd>Help</kbd> > <kbd>Eclipse Marketplaceā€¦</kbd></kbd>
52 2. Search for _ANSI Escape in Console_
53 3. Click the <samp>Install</samp> button of the plugin
54 4. Follow the instructions and agree again with the security warning for unsigned content.
55
56 Once both plugins are installed, restart Eclipse as prompted.
57
58 # Configure Eclipse for QMK
59 (todo)