Skip to content

Setting Up For 2019 Java Software Development in Windows

Kevin Lam edited this page Dec 6, 2018 · 1 revision

In the 2018-2019 season, we are switching to a new development environment based on Visual Studio Code. For fall 2018, follow the instructions from the wpilib alpha test to get this going.

These instructions assume Windows 10:

  1. Install a Java 8 JDK (JDK, not JRE). Download one from here: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Yes, we'll be going to Java 11 in January... but for now, we're still using last year's software which is Java 8.

  1. Set a Windows System Environment variable called JAVA_HOME and point it to your JDK install location, e.g. JAVA_HOME=C:\Program Files\Java\jdk1.8.0_191

  2. (Optional) Add the Java directory, e.g. C:\Program Files\Java\jdk1.8.0_191\bin, to your system path environment variable. Here's how.

To verify that this worked, open a Command Prompt and type the following command "java -version". The command should not fail, and should print out the version of Java you installed.

  1. Download and install Visual Studio Code following the instructions from Screen Steps Live: https://wpilib.screenstepslive.com/s/currentCS/m/79833/l/932382-installing-vs-code

  2. Search for and install the VS Code plugins according to the Screen Steps website: C/C++ plugin, Java Extension Pack. Reload VS Code after installing each plugin.

  3. Download the latest alpha version of the vscode-wpilib-2019.0.0-alpha-4.vsix file from GitHub: https://github.com/wpilibsuite/vscode-wpilib/releases/tag/v2019.0.0-alpha-4

Manually install this plugin according to the instructions from Screen Steps Live.

  1. Download the FRC 2018 Update Suite (version 2018.1.0) from National Instruments: http://www.ni.com/download/first-robotics-software-2017/7183/en/

Note: this is a large download, and you will need to create a free NI login account. Expect to do this again after kickoff when they release an FRC 2019 Update Suite.

  1. Install the FRC 2018 Update Suite. Ignore any requests for serial numbers, these apply to specific National Instruments software that our team doesn't use. (If your team does need it, refer to the serial numbers provided in your kit of parts.)

Additional libraries

Team 2706 uses Talon SRX motor controllers and the Kauai Labs NavX-MXP gyro/IMU. These have additional libraries that must be installed. (I think?)

Download and unzip these installers and run them. Both installers put their code into a local maven repo (unfortunately both of these place them in different local maven repos... sigh) and for the alpha version you are expected to edit your gradle configuration to point to them. The final release will automate this process.

Editing your gradle configuration for CTRE stuff

See Example: https://github.com/JCaporuscio/phoenix-gradlerio-examples/blob/master/FirstJava/build.gradle

repositories{
     maven {url "${System.getProperty('user.home')}/releases/maven/release/"}
     maven {url "http://devsite.ctr-electronics.com/maven/release/"}
}

ext.PhoenixVersion = "5.8.1"

dependencies {
    compile wpilib()
    compile "com.ctre.phoenix:api-java:${PhoenixVersion}"
    compile "com.ctre.phoenix:wpiapi-java:${PhoenixVersion}"
    nativeZip "com.ctre.phoenix:cci:${PhoenixVersion}:linuxathena@zip"
    compile ctre()
    compile navx()
}

Setting Up The RoboRio

The RoboRio must be running the latest 2018 image (v17). If you're using an older RoboRio, or a brand new one, connect it to your PC via USB, run the RoboRio imaging tool, and flash it with the image. You'll need to do this first before you can deploy code!

Other useful tools

We find the following tools to be helpful for software development:

Working through alpha issues

This ChiefDelphi thread answers a lot of questions about how to do stuff using the 2019 alpha release.