Skip to content

Linux development

uakotaobi edited this page Jan 16, 2017 · 4 revisions

Table of Contents

Setting up Eclipse on Linux

Installing Eclipse on Linux is the easy part. Your distro's package manager will usually have a package called eclipse which will pull in everything you need.

But when you clone our 2017bot repository and import it into Eclipse, you will notice build errors for the entire edu.wpi.first.wpilibj namespace hierarchy. To fix this, you need to also install the WPILib Eclipse plugin. On Windows, there is an installer that takes care of this, but Linux users have no such luck!

Following either of the following strategies should make the build errors vanish. Note that Eclipse needs to restart in order to "see" the plugins.

The easy way

It wasn't immediately obvious to me but as it turns out[1], there's an official Eclipse plugin repository for FRC. Downloading the plugins that way eliminates the need to build them locally.

  1. From Eclipse, navigate to Help → Install New Software → Add.
  2. Set Name to "FRC Plugins" and set Location to http://first.wpi.edu/FRC/roborio/release/eclipse/.
  3. Click Ok and wait for a few seconds.
  4. Eclipse will list the C++ and Java plugins available there. Select both and then accept the license agreement.

The hard way

This was the approach I first took. It works fine, though it takes more effort.

    1. From a forum post[2], I learned where to find the source code for WPILib.
    2. Conveniently, one of the pinned Git repositories was EclipsePlugins, which I cloned to a local directory using:
      git clone -v https://github.com/wpilibsuite/EclipsePlugins.git ~/FRC-Eclipse-Plugins
    3. The instructions in the repo's README file stated that building would require Java 8 (which I already had) and Maven (which I did not), so I installed my distro's maven package.
    4. Building was as simple as entering the FRC-Eclipse-Plugins directory and executing ./gradlew build. The build involved a lot of Maven downloads into ~/.m2 so it took a while, but that only had to be done once.
    5. As the README file states, after the build, the Eclipse plugins are copied to ~/FRC-Eclipse-Plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/. (Note the site.xml file in that location; it's important.)
    6. I was stuck for what to do next until a web search for wpilib install eclipse plugins<tt> turned up the "Intro to Eclipse Plugins" page on the (official?) WPILib Developer's Guide <ref>https://petermitrano.github.io/WPILib_Developers_Guide/tutorials/Eclipise%20Plugins/intro_to_eclipse_plugins.html, retrieved 2017-01-16.</ref>
## Following the instructions there, I navigated to Help &rarr; Install New software &rarr; Add &rarr; Local &rarr; and browsed to <tt>~/FRC-Eclipse-Plugins/edu.wpi.first.wpilib.plugins.updatesite/target/site/. (I knew I had the right directory because of the presence of site.xml.) Eclipse listed the C++ and Java plugins available there, I selected both, and then accepted the license agreement.

References

  1. ^ http://wpilib.screenstepslive.com/s/4485/m/13810/l/145002-installing-eclipse-c-java, retrieved 2017-01-16.
  2. ^ https://www.chiefdelphi.com/forums/showthread.php?p=1387787#post1387787, retrieved 2017-01-15.
Clone this wiki locally