Java code for 2018 year (Power Up)
To have required libraries, must install eclipse plugin "Robot Java Development" by WPI
https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599681-installing-eclipse-c-java
- open eclipse and click "help" in the top tool bar
- click "install new software"
- click "add" near the top of the window
- in the "name" field enter "FRC plugins"
- in the "location" field enter "http://first.wpi.edu/FRC/roborio/release/eclipse/"
- click ok
- check the WPILib Robot Development plugin box
- (optional) select which language to install from the drop down under WPILib Robot Development
- click next at the bottom of the window, the plugin will begin to download and install
- click ok on the window about unsigned content when it appears
- restart eclipse for the plugin to take effect
Documentation of the libraries used in frc (for java programming) can be found here: http://first.wpi.edu/FRC/roborio/release/docs/java/
If you are still expericing build path errors try these steps courtesy of team #3504 (https://github.com/GirlsOfSteelRobotics/Docs/wiki/Programming-Environment-Set-Up)
The projects imported in the step above might all show build path errors. If you see this issue, it can be fixed by creating a temporary project based on a WPIlib template. The process of creating a new project will define a set of build variables needed by all robot projects. Once created, the temporary project can be removed.
- Create a temporary FRC Java project
- From the File menu, choose New...
- In the submenu, choose Project (NOT Java Project!)
- Open WPILib Robot Java Development
- Select Example Robot Java Project
- Click Next >
- The Select Example Project to Create wizard opens
- Choose GearsBot, click Next >
- Enter the Project Name "temp"
- Click Finish
- All (or at least most) of the errors should disappear after a minute
- Now delete the "temp" project:
- Right-click on "temp"
- Select Delete from the pop-up menu
- IMPORTANT: enable the "Delete project contents on disk" option to clean up the unneeded files
- Click OK