FindBugs - rsanchez-wsu/jfiles GitHub Wiki
FindBugs is a program that can be used as a plug-in for Eclipse. FindBugs looks for bugs in your Java code. More information about this free software can be found at http://findbugs.sourceforge.net/.
Contents
Requirements
-
Eclipse: Eclipse IDE will be our recommended development environment for this project. Download Eclipse at this link: https://www.eclipse.org/downloads/
-
Ant: The latest versions of Eclipse come bundled with the Ant plug-in.
-
JDK: A Java Development Kit of 1.5.0 or later is required. You most likely have this installed from a previous class. Otherwise, head here to download and install the latest version: http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Installation
1) Open Eclipse. Click on the Help
menu, then the Eclipse Marketplace
menu item.
2) Search for FindBugs
in the marketplace. Click to install the plugin and follow the prompts.
If nothing pops up for FindBugs
, you will need to manually add the correct repository.
Using the FindBugs Plug-in
In Eclipse, open a project. In the Package Explorer
on the left-hand menu (tree view), right-click on your project and find the Find Bugs
menu option. This will call FindBugs to run and show problem markers in your code if it finds any issues. The problem markers are displayed in the source window, similar to Eclipse problem markers.
If you do not see the Package Explorer
view, simply click on the Window
menu at the top of Eclipse, choose Show View
, and select Package Explorer
.
Troubleshooting
Installation Troubleshooting
2a) To manually add the FindBugs repository, exit out of the marketplace, then click on the Help
menu, then the Install New Software
menu item. You can choose or add a repository to search for plugins. Click the Add
button from the window that is already open. You may name the new repository anything you wish, but you will need to add the following URL for the Location:
http://findbugs.cs.umd.edu/eclipse/
. Click OK
when done, and the software will add and search the new repository.
2b) If you select the new repository you added (in the image, we named it the "FindBugs Repository"), the software will search the URL for appropriate plug-ins. It should only find one, which will show up in the window after several seconds. Select the FindBugs
plug-in package, then click Next
. You will be required to click a few more Next
buttons, accept the license agreement, accept the new unverified source, and restart Eclipse. After your restart, FindBugs will be active.