checkstyle4bluej is a BlueJ plugin that allows you to use the Checkstyle source code analysis tool. The user is provided the ability to choose what Checkstyle configuration file to use.
Note: It is important that the configuration file is compatible with Checkstyle version 9.2.
- Download the latest version of the extension found here
- Move the downloaded JAR to a BlueJ extensions2 directory
- Start BlueJ
BlueJ Extensions can be installed in three different directories:
User directory
installs for this userSystem directory
installs for all users of this systemProject directory
installs for this project only
To install for a project, make a directory called extensions2
in the projects root directory and move the JAR to that directory.
In order to install for a user/system place the JAR in one of these directories:
Operating System | Install-type | Directories |
---|---|---|
Mac | User | $HOME/Library/Preferences/org.bluej/extensions2 |
System | <BLUEJ_HOME>/BlueJ.app/Contents/Java/extensions2 |
|
Unix | User | $HOME/.bluej/extensions2 |
System | <BLUEJ_HOME>/lib/extensions2 |
|
Windows | User | %USERNAME%\bluej\extensions2 |
System | %PROGRAMFILES%\BlueJ\lib\extensions2 |
Tip: For Mac users, Control-click BlueJ.app and choose Show Package Contents to find the system directory.
For further information about Extensions in BlueJ see: BlueJ Extensions
The Checkstyle Plugin runs checks in BlueJ when a Project/Package is opened and when a class file's state changes. The plugin ignores files that have not been compiled.
You can view the violations discovered by choosing Show Checkstyle overview
from the Tools
menu.
From the overview window you can double-click a violation to highlight the text in the BlueJ editor.
Which configuration file to use can be defined in the BlueJ preferences.
You can find the preferences by choosing Preferences...
from the Tools
menu and navigating to the Extensions
tab.
The selected default config will be loaded by default, but can be changed from the dropdown menu in the overview window.
Are you experiencing bugs/problems using this plugin?
Submit a bug report with detailed reproduction steps.
We also appreciate ideas of enhancements and new features, feel free to suggest new features here.
Contributions are welcome. Feel free to discuss the changes with us in a feature request before submitting a Pull Request.
This plugin relies on the usage of the BlueJ Extensions2 API. The latest version is added to this repository in the lib
directory.
The bluejext2 jar is bundled with the BlueJ installation, it can be retrieved from there. Detailed instructions can be found in the BlueJ documentation.
A toolscript is available for Windows users to update the API, it can also be used as a reference as on how to install new versions of the API to the lib directory.
The current version of the API is version 3.2, from version 5.0.2 of BlueJ.
Note: the script assumes BlueJ is installed for all users.
A lot of core functionality for this plugin is provided by BlueJ-Linting-Core, feel free to take a look at it as well.