FindBugs as an Eclipse plug-in and Ant tool for installation, use

Source: Internet
Author: User


My tutorial is divided into plug-ins and ant tools for both types of use.

If the Java version in your PC is lower than JDK 7, it is recommended to use offline installation. Due to the minimum requirements of the JAVA7 operating environment for the latest findbugs online

1 , offline installation

Download in http://sourceforge.net/projects/findbugs/files/findbugs%20eclipse%20plugin/2.0.2/
Files to the Plugins subdirectory of Eclipse, restart eclipse

2 , online installation

(1) Click "help->installnew software", such as:1. Click "help->installnewsoftware", such as:


(2) Click "Add" and then enter "findBugs" in the popup "Name", "location" enter "HTTP// Findbugs.cs.umd.edu/eclipse ", click"OK", as


(3) Select the corresponding plugin and click "next->next->finish".


(4) After completing the installation, restart Eclipse, right-click on the project file or directory, you will find a Findbugs menu, such as:


Well, so far, we've installed the findbugs.

Installation process, encountered problems, I think the most likely is the JDK version of the problem, upgrade it. Upgrading is not a bother. There are other questions that can be queried http://findbugs.sourceforge.net/FAQ.html

Above is the way to install the run findbugs via plugins.


Also, I tried the ant tool to run, and then I said step

1, first download and install the general version of the FindBugs http://findbugs.sourceforge.net/downloads.html

2, create build.xml under the project that needs to be inspected, and edit enter the following, "Enter your own path here" is to enter your FindBugs path.

<?xml version= "1.0" encoding= "UTF-8"? ><project name= "MyTest" default= "All" ><property name= " Findbugs.home "value=" here Enter your own path/findbugs-3.0.0 "/><path id=" Findbugs.path "><fileset dir=" Enter your own path here/ findbugs-3.0.0 "><include name=" **/*.jar "/></fileset></path><taskdef name=" FindBugs " Classname= "Edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref= "Findbugs.path"/><!--define FindBugs's home, FindBugs task to use--><target name= "findbugs" ><mkdir dir= "findbugs"/><findbugs home= "${ Findbugs.home} "output=" html "outputfile=" findbugs/calendar-fb.html "><!--definition findbugs find the classpath-->< Auxclasspath path= "${findbugs.home}/lib/findbugs-ant.jar"/><auxclasspath><fileset dir= "Lib" includes= "*.jar"/></auxclasspath><sourcepath path= "src"/><class location= "Bin"/></findbugs> </target></project>


3, start the command line on the current project path line, Ant-f Build.xml is OK.

Finally, I enclose the result of my running success ~


You can see some of the usual code bugs are still very much, Da da da, change the bug to go.

FindBugs as an Eclipse plug-in and Ant tool for installation, use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.