Skip to content

Development Environment Setup

Eli Smith edited this page Sep 23, 2018 · 14 revisions

Development Environment Setup

So you want to know about how to set up the development environment for Team 3128's code, would you Narwhals?
I suppose I can
Teach you a thing or two.

If you're all about steam and brass
All you need to start is tea and a flask...

Anyway, carry out the following steps to get your personal computer ready for writing and deploying robot code.

Step 0 (WINDOWS USERS): Setup System Variables

Visual Studio Code (and most Java IDEs) require that you install both the Java JDK and the Java JRE and setup your environment variables to access them. To do this, follow these steps:

  1. Open your File Explorer
  2. Find your Program Files folder under Local Files (C: Drive)
  3. Find the Java Folder
  4. If you have two folders prefixed jdk and jre, then you can skip to step 6.
  5. Google Java JDK and Java JRE. Install both through the installer on the official website.
  6. Once you have gone through the installation process for both, click on the windows icon on the bottom left of your screen and search for Environment Variables, then click the option called Edit the system environment variables.
  7. Click Environment Variables in the bottom right.
  8. In the System Variables window (the window on the bottom), select Path and click Edit.
  9. Click New.
  10. Head back to your Java folder where a JRE and JDK folder should exist.
  11. Open the JDK folder and open the folder within it titled bin. Click the top of the File Explorer search, you should be able to copy something similar to this String. C:\Program Files\Java\jdk1.8.0_152\bin. Copy it.
  12. Paste this into your 'New' Entry in the Environment Variables.
  13. Repeat these steps but for your JRE.
  14. Now you can install VSCode and it will work correctly with Java.

If you have already installed VSCode, then restart it after performing the steps above.

Step 1: Download and install Visual Studio Code

Visual Studio Code is a lightweight, customizable, Electron-based, and open-source text editor from Microsoft. The only things that sets it apart from a normal text editor, besides the obvious project-oriented nature of managing files, is the native Gradle and Maven support and IntelliSense, which is basically syntax highlighting and "smart" method, class, object, and variable autocomplete. It works relatively well as an IDE and is really easy to use; more importantly, it's fast and cross-platform. Because of this, we switched from Eclipse to VSCode in the 2019 season (actually, it's because the official IDE was switched from Eclipse to VSCode, so here we are).

Install Visual Studio Code. Go to https://code.visualstudio.com/download, download the installer for you operating system, open the installer, and follow the on-screen instructions to install the IDE.

Step 2: Install the Visual Studio Code extension for Java

VSCode allows for the addition of extensions, which is how the bare-bones IDE can get support for a whole host of languages and cool features.

Our robot code is developed in Java, so we need to install the Java extensions.

  1. Go to the extensions panel by clicking the fifth button from the top on the left sidebar
  2. Search for Java Extension Pack
  3. Click the green Install button, and wait for the installation to finish
  4. When it appears, click the blue Refresh button

Step 3: Install the Visual Studio Code extension for WPILib

We also need to install the WPILib extension that gives us shortcuts for doing various tasks, including building and deploying our robot code.

  1. Download the .vsix from https://github.com/wpilibsuite/vscode-wpilib/releases (download the topmost one)
  2. Navigate to the Extension panel in VSCode
  3. Click the menu button on the top right of the extension list
  4. Click the Install from VSIX... option near the bottom of the menu
  5. Select the .vsix you just downloaded from WPILib's GitHub page
  6. Wait for the extension to install
  7. Click the blue Reload Now button on the bottom right of the screen and wait for VSCode to restart.

And that's it! Your computer is now ready to develop robot code. To start working in one of our libraries or to make a new project, check out Working on Robot Code.