2014 FRC Control SystemGetting started with Java Beyond the BasicsBuilding with a custom version of the WPILib source code

Building with a custom version of the WPILib source code

This document details how to build your own custom version of the WPILibJ library, then use that library to build your robot program.

Verify Necessity

Verify that you truly need to modify WPILib before beginning. Many desired changes to or extensions of WPILib classes can be made by making a renamed copy of the class in your team code or making a class that extends the WPI class. This approach is often preferable to modifying WPILib as it makes it much easier to integrate any updates to the libraries.

Unzip the WPILibJ project

Unzip the WPILibJ project

You will want to base your custom WPILibJ project off the source included with the latest plugins. Browse to the USER\sunspotfrcsdk\lib folder, then locate and unzip the wpilibj.project.zip file (Note that the USER directory varies based on the operating system and name of the user, if necessary you should be able to perform a search on your machine to locate the sunspotfrcsdk directory.)

Open the Project

Open the Project

Open Netbeans and select File >> Open Project. Browse to the sunspotfrcsdk\lib folder and select the wpilib.project project, then click Open Project

Building the Custom WPILib

Building the Custom WPILib

You now have a copy of the WPILibJ project in Netbeans. Make any code changes you would like, then right click on the project and select Build.

Building Robot Code with Custom WPILib

Building Robot Code with Custom WPILib
  1. To build Robot programs using this custom WPILibJ library, open the Netbeans options by selecting Tools >> Options.
  2. Click the Miscellaneous tab on the top ribbon,
  3. Then the FRC Configuration tab on the secondary ribbon.
  4. Check the box next to Use Alternate WPILibJ library and click Browse. Browse to your custom version of the library (in sunspotfrcsdk\lib\wpilibj.project\dist\lib\wpilibj.jar if you did not move it). then click OK.

Your robot projects will now build using your customized version of WPILibJ. If you have changes, fixes or additions that you think would benefit the FRC community at large, please feel free to submit them as patches via the Bug Tracker on the FIRSTForge WPILib project.