Installing Eclipse (C++/Java)

The current suite of text-based languages, Java and C++, utilize the current version of Eclipse as a development environment. The FRC specific tools for the chosen language are installed as Eclipse plugins. You can install both the Java and C++ development tools into the same installation of Eclipse to allow programs to be written with either language using a common set of tools and user interface.

The Eclipse plugins have been tested with Eclipse Luna, Eclipse Mars, Eclipse Neon, and Eclipse Oxygen. Teams with existing installs from 2017 can update their installations to 2018 by following the updating the plugins when prompted by opening Eclipse (if automatic update is enabled) or following the Updating the plugins manually instructions below. C++ teams should also install the new toolchains (Installing the C++ Toolchains).

CAN Talon SRX has been removed from WPILib. See this blog for more info and find the CTRE Toolsuite installer here: http://www.ctr-electronics.com/control-system/hro.html#product_tabs_technical_resources

Note: The C++ and Java tools and environment are available for Windows, Mac OSX and Linux, though the Windows version is the one that has been the most heavily tested. You should be able to use any of the three for your development platform, however you should keep in mind that you will need a Windows computer to run the Driver Station software and roboRIO Imaging tool.

Warning: Java 9 is not currently supported by the FRC tools. Java 9 introduces many breaking changes, and is not provided for 32-bit systems which we need to support. Java 9 will not be supported for 2018.

Getting Java

Getting Java

To use Eclipse you must have a Java 8 JDK installed on your system. You can get Java from the web site: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. Do not select Java 9!

Scroll down the page to "Java SE Development Kit". Accept the license agreement and download the Java SDK for your platform. The version (either x86 or x64) should match the version of Eclipse that you have installed or plan to install on your computer. This has been tested with Java SE 8u151 but will probably work with later versions as well.

Java 8 is installed on the RoboRIO and to take advantage of all the features it offers, it is suggested that you use Java 8 on your development system. You may use an earlier version, however it should be noted that the rioLog Eclipse plugin which is used to view console output requires Java 8, and other WPILib tools (dashboards, etc.) may as well.

Note: Java is required to be installed even if you are doing C++ development since Eclipse, the development environment, is a Java program. Also, the Oracle web page might change over time, so the images shown here might not exactly match what you see.

Installing the C++ Toolchains (C++ teams only)

Installing the C++ Toolchains (C++ teams only)

If you have toolchains installed from a prior season, you should uninstall them using Add/Remove and install the new toolchains

Download the appropriate C++ Toolchains installer for your platform from http://first.wpi.edu/FRC/roborio/toolchains/

Windows: Double click on the downloaded file to launch it. If you receive a Security Warning, click Run. Check the box to accept the License Agreement, then click Install. When the install completes, click Finish.

Mac OSX: Double-click on the downloaded file in Finder to unzip it. In Finder, right-click on the "FRC ARM Toolchain.pgk" file, then press the option key on your keyboard, and click "Open". Follow the steps to install the package.

Linux: See the instructions in the text file on the toolchains page.

The Windows toolchains will always install to the root of the system drive.

Getting Eclipse

Download Eclipse

Download Eclipse

You can get eclipse from the web site: https://www.eclipse.org/downloads/eclipse-packages/

Select the version of eclipse that matches your desired programming language (there are instructions below for adding C++ to Java or Java to C++). You should choose the version of eclipse that matches your operating system and version of Java from above.

At the time of this writing the current version is Oxygen (4.7) and that is what we've been using for development of the tools. On the next screen choose a download site and start the download. Choose a location such as the downloads folder for the zip file.

Note: on 64 bit Linux systems it might be necessary to install 32 bit version of libc. For example, on Ubuntu Linux, the command would be:

sudo apt-get install libc6-i386

This is necessary to run the gcc binaries as part of the plugins since they are compiled for 32 bit linux.

Eclipse also provides .exe installers now. Other than changing the next few instructions, these should work fine as well.

Unpack the eclipse folder and move it to Program Files

Unpack the eclipse folder and move it to Program Files

Extract the contents of the zip file by right-clicking on the .zip file in a windows explorer window and selecting "Extract All..." and taking the default for the location to extract it.

Move the extracted eclipse folder to Program Files

Move the extracted eclipse folder to Program Files

Move the extracted folder to Program Files or some other convenient location from which to easily run it. Within the eclipse folder you'll see the file "eclipse.exe". You can right-click on "eclipse.exe" and select "Pin to start menu" to make it easier to run eclipse without having to find the installation location.

Starting Eclipse for the first time

Starting Eclipse for the first time

Start Eclipse (it will be on your start menu if you chose to pin it from the previous step.) The first time Eclipse starts it will ask you for the location of your workspace. A workspace is the location on disk where projects and files are stored by default. You can have more than one workspace, but it's suggested to take the default location until you have more experience with Eclipse.

Adding C++ to Java Eclipse
Adding C++ to Java Eclipse

To program C++ with the Java version of Eclipse, you will to have the C++ Development Tools (CDT) installed. To determine if they're already installed, select Window, then Preferences from the menu bar. Then look for C/C++ on the left side of the Preferences window. If it is missing then you must install it. The installation procedure is in the next step.

Install Eclipse C++ Development Tools

If C/C++ is missing from the preferences window (see previous step), then it must be installed

  1. Close the Preferences window if it's open.
  2. Select Help, then Install New Software... from the menu bar.
  3. Click the dropdown and select the "Neon" site as shown.
  4. Scroll down to the Programming Languages section and click the arrow to expand.
  5. Click the checkbox to choose Eclipse C++ Development Tools
  6. Click Next.
  7. Take the defaults for the other options and let Eclipse restart.

When these steps are finished, and Eclipse has restarted, C++ should be an available option on the Preferences window, and all the C++ perspectives will be available.

Adding Java to C++ Eclipse
Adding Java to C++ Eclipse

To program Java with the C++ version of Eclipse, you will need to have the Java Development Tools (JDT) installed. To determine if they're already installed, select Window, then Preferences from the menu bar. Then look for Java on the left side of the Preferences window. If it is missing then you must install it. The installation procedure is in the next step. If you do have the Java development tools installed (Java is shown), then skip the next step and continue configuring to Setting up the JDK in Eclipse.

Install Eclipse Java Development Tools

Install Eclipse Java Development Tools

If Java is missing from the preferences window (see previous step), then it must be installed

  1. Close the Preferences window if it's open.
  2. Select Help, then Install New Software... from the menu bar.
  3. Click the dropdown and select the "Neon" site as shown.
  4. Scroll down to the Programming Languages section and click the arrow to expand.
  5. Choose Eclipse Java Development Tools
  6. Click Next.
  7. Take the defaults for the other options and let Eclipse restart.

When these steps are finished, and Eclipse has restarted, Java should be an available option on the Preferences window, and all the Java perspectives will be available.

Setting up the JDK in eclipse (Java teams only)

Setting up the JDK in eclipse (Java teams only)
  1. Select Windows from the menu bar, then Preferences.
  2. Choose Java preferences in the list on the left of the Preferences window, then Installed JREs.
  3. Be sure that the installed JDK is selected as shown (make sure the "Location" field includes jdk 8 or 1.8, the name field may be the same in either location). This will enable eclipse to build Java programs for the RoboRIO. Without this setting you will see error messages about the JRE path not being set correctly.

If you have no entries, or your only entry does not say jdk in the Location, proceed with the next step. Otherwise, skip the next step.

Adding the JDK
Adding the JDK

Only if the JDK is not shown in the step above:

  1. Click Add
  2. Select Standard VM
  3. Click Next
  4. Click Directory and browse to the folder for the JDK (usually C:\Program Files\Java\* or C:\Program Files (x86)\Java\*). The image shows jdk1.7.0_51, you will likely have a jdk1.8.* version.
  5. Click OK. Pick a name for the JRE such as JDK8.
  6. Click Finish
  7. Make sure the box for the newly added JDK entry is checked.

Configuring eclipse

Configuring eclipse

There are a huge number of configuration options for eclipse to set up the environment for your preferences. One suggested setting to note is: "Save automatically before build." This setting will cause all of your workspace changes to be saved when you build the project. If you don't set this, remember to save changes before building, otherwise the rebuilt program won't reflect your newest updates.

To set this, go to Window -> Preferences -> General -> Workspace -> Check Save automatically before build -> OK

Automatic Updates

Automatic Updates

Another recommended setting is enabling Automatic Updates. With Automatic Updates enabled, Eclipse will check for updated versions of the plugins each time it starts and inform you if an update is available. This will help insure you are notified of new versions of the WPILib plugins.

To enable Automatic Updates, select Install/Update then Automatic Updates. Check the box at the top to Automatically find new updates and notify me. Select the radio button to Look for updates each time Eclipse is started. Then click OK.

Installing the development plugins - Option 1: Online Install

It is recommended to install the plugins using this method, which requires an active internet connection and fetches the plugins directly from the WPILib site. This will allow you to check for updates to the plugins using Eclipse.

Eclipse extensions are based on user-installed plugins. To get the WPILib development tools you will need to install the correct plugin for your language.

When Eclipse starts:

  1. Select "Help"
  2. Click "Install new software".
  3. From here you need to add a software update site, the location where the plugins will be downloaded. Push the "Add..." button then fill in the "Add Repository" dialog with:
  4. Name: FRC Plugins
  5. Location: http://first.wpi.edu/FRC/roborio/release/eclipse/
  6. Click "OK".

Selecting the correct plugins

  1. Click the arrows if necessary to expand the WPILib Robot Development menu.
  2. Select the WPILib Robot Development plugin for your desired language (you can install both if you wish to try programming in both languages)
  3. Click Next, Next on the next page, then click the radio button to accept the license agreement and click Finish
  4. If you receive a Security Warning prompt, click OK to continue.
  5. When prompted, restart Eclipse. After Eclipse restarts and you select your Workspace (if prompted) you will see a dialog that says Installing Java. This details the installation progress of the plugins, wait for the install to complete before proceeding. This dialog should only appear when the plugins are first installed or updated.

Installing the development plugins - Option 2: Download and install offline

If you need to download the plugins and install them on a different machine offline, you will be unable to check for updates using Eclipse. Download the zipfile containing the plugins from http://first.wpi.edu/FRC/roborio/release/ Right click on the zip and select Extract All to extract the files.

When Eclipse starts:

  1. Select "Help"
  2. Click "Install new software".
  3. From here you need to add the downloaded plugin location. Push the "Add..." button then fill in the "Add Repository" dialog with:
  4. Name: FRC Plugins Offline
  5. Click Local
  6. Browse to the "site" directory inside the directory you extracted the zip file to.
  7. Click "OK".

Selecting the correct plugins

  1. Click the arrows if necessary to expand the WPILib Robot Development menu.
  2. Select the WPILib Robot Development plugin for your desired language (you can install both if you wish to try programming in both languages)
  3. Click Next, Next on the next page, then click the radio button to accept the license agreement and click Finish
  4. If you receive a Security Warning prompt, click OK to continue.
  5. When prompted, restart Eclipse. After Eclipse restarts and you select your Workspace (if prompted) you will see a dialog that says Installing Java. This details the installation progress of the plugins, wait for the install to complete before proceeding. This dialog should only appear when the plugins are first installed or updated.

If updated plugins are released, you can either repeat this process ( you will get one additional Eclipse window telling you that the components are already installed and an upgrade will be performed instead of an install), or if online installation is an option, you can complete the online installation steps above, then get future updates using the Eclipse Automatic Updates (or the manual update check described below)

Updating the plugins manually

Updating the plugins manually

Note: This only works if the plugins were installed using Option 1 - Online Install from above. For updating plugins when the offline install was used, see the note at the end of the step above.

If you choose not to enable Automatic Updates as described above, you will need to manually have Eclipse check for updates to install new versions of the plugins.

Select Help from the menu bar, followed by Check for updates. Eclipse will check if there is a newer version available of any installed plugin and inform you if an update is found. Updating the plugins will ensure that your development system is up to date with the latest version of the development tools.

Troubleshooting

Below are some troubleshooting steps for commonly encountered issues

Unable to read repository at http://first.wpi.edu/FRC/roborio/release/eclipse/content.xml

Unable to read repository at http://first.wpi.edu/FRC/roborio/release/eclipse/content.xml”

This error occurs if Eclipse cannot contact the server to download the plugins. There are a couple possible causes of this issue:

  1. Your computer is not connected to the Internet. Verify your network connection and try again.
  2. Your firewall is blocking Eclipse. Try adding an exception for Eclipse or disabling your Firewall.
  3. Your proxy settings were read improperly by Eclipse. In Eclipse Select Window->Preferences->General->Network Connections. If you don't use a proxy or don't know, set the Active Provider to Direct. If you use a proxy set the Active Provider to Manual and configure the proxy information by selecting the protocol and clicking Edit.

Need Java 1.7 or newer

If you get an error message when attempting to run Eclipse that says you "need Java 1.7 or newer", you have mismatched versions of Java and Eclipse installed. The easiest fix is to go back and download the other version of Eclipse (32 bit if you had 64, 64 if you had 32).

0 Report Errors

Use this form to report any errors with the documentation. For help with WPILib, please use the FIRST Forums at http://forums.usfirst.org For reporting WPILib bugs, please submit an issue on GitHub at https://github.com/wpilibsuite/allwpilib/issues/new

Ignore