The Checker Framework is a pluggable type-checking system for Java: It warns you, at compile time, about errors in your programs, beyond those that Java's built-in type-checker does. This document tells you how to get started using the Checker Framework in Eclipse. However, the Checker Framework Eclipse Plugin is no longer supported and is out of date. Therefore, you are highly recommended to follow the Eclipse instructions in the Checker Framework manual.
This plugin has been tested on Oxygen.1a Release (4.7.2) using Java 8. Older versions running on a Java 8 VM can be used with the plugin. However, the Checker Framework Eclipse Plugin is no longer supported and is out of date. Therefore, you are highly recommended to follow the Eclipse instructions in the Checker Framework manual.
Here is how to run one or more built-in type checkers from the Checker Framework:
A progress dialog will inform you as the plugin performs these steps:
removing old markers, running the type-checker(s), and updating the problem list
You can select the "Problems" window to see all the type-checking errors.
In the editor, a warning marker will appears to the left of each line that has a type-checking error. You can hover over the warning marker to view the given error. The errors are also output to the console formatted as they appear when running the Checker Framework from the command line, but most users do not view the console.
You may clear all Checker Framework error markers by right-clicking on the project and selecting: (Checker Framework ‑> Clear Checker Markers).
The Checker Framework
also allows you to write a custom checker that enforces rules of your own.
To run a custom checker that you have written, do the following:
Your custom checker will now appear in the menu "Run Custom Checker" when you right-click a project, package, or file and open the "Checker Framework" sub-menu. You can run your custom checker in a manner similar to that described in "Running Built-In Checkers".
If you wish to run several checkers at once follow the instructions below:
Opening the Preferences Page
To open the preferences page for the Eclipse plugin you must first open Eclipse's preferences (usually Window‑>Preferences or Eclipse‑>Preferences depending on your platform). Then select "Checker Framework" from the list of preferences.
Filtering error messages
You can provide a regular expression under "Regex for warning/error filter" to filter error messages. Any error messages that match the given regular expression will not be output in the problem view and will not show any error markers.
Using a specific version of Java
The Eclipse plugin will start a new Java process in order to run the Checker Framework compiler. You may select which version of Java will run the Checker Framework via the text-field labeled "Java Home Directory" or press the "Browse" button to select Java home via a dialog. Otherwise, the version used to run Eclipse will also be used to run the Checker Framework compiler.
The Checker Framework supports command-line options to its compiler (usually prefaced by -A). One way to use these options is enabling the various options under the label "Processor/build options". If you are using the Checker Framework on a project for which other developers are not, you may be specifically interested in its backward compatibility features, such as annotations in comments and implicit import statement. If you check the box next to the text "Use implicit imports for annotation classes" then, for built-in checkers, all of the appropriate annotations will be imported implicitly.
Additional compiler parameters
The Checker Framework compiler has many options, including all of the standard javac options. You may wish to pass a javac option to the Checker Framework compiler or a Checker Framework option not explicitly listed in the "Processor/Build Options" section. To add custom options, press the "Add" button found in the "Additional compiler parameters" section. In the provided text box, add one or more options as they would appear on your command line. Each option, or group of options, added in this manner will appear on a line in the options table above the "Add" button. The options provided by a line in this table may be activated and deactivated via the check box to the left of its definition. Any line that has a checkmark to its left will be added to the command line when the Checker Framework is run.
To get support for either the Checker Framework or this plugin please first consult the Checker Framework Manual, specifically the chapter "Troubleshooting and getting help" . If you find a bug, please report it at https://github.com/typetools/checker-framework/issues (first, check whether there is an existing bug report for that issue). You can also get help via the discussion group checker-framework-discuss.
To install and use the Checker Plugin, you do not need to access or compile the source code.
However, if you would like to read or modify the source code, it is publicly available.
The code for the Eclipse plugin can be found within the
Checker Framework version control repository (https://github.com/typetools/checker-framework/ in the
To obtain your own copy of the source code, execute the following command: