How to count lines in a netbeans project

me me picture me me · May 19, 2012 · Viewed 40k times · Source

Hello I have netbeans 7 and I was wondering how to calculate the total lines for a project. I have looked through Google but every time I do it I only find dead ends or non working plugins. Does anyone know how to count the lines?

Answer

alain.janinm picture alain.janinm · May 19, 2012

You can use wordcount that works with 7.1 nb-wordcount that works with 8.2.

To configure wordcount go in Tools->Options->Miscellaneous. You have to change Accept filename if you want other files than Java and Groovy to match.

To display the count window go in Window->Open WordCount Window.

To display stats click on WordCounting (second button). I will display the stats of the directory selected in Projects (window)(it has to be a package or something like Source Packages or Web pages, it won't work if you select the project).

Also if you are on linux you can simply execute :

 find . -name '*.java' | xargs wc -l