try this,
import java.util.regex.*;
.......................
Pattern pat = Pattern.compile(<regexp>

;
Matcher match = pat.matcher(<file content>

;
int count = 0;
while(match.find()) {
count++;
}
note : <regexp> - pattern of your word to be counted
<file content> - you can match line by line of the file, or you
can make the file contents to stringbuffer
assumption : you are using jdk1.4 or more