when the function
public static void main(String[] args)
is the problem - then you should not start it. Problem solved.
Or rather not figured out correctly.
Your code above says nothing about the parsing of a file.
When you're parsing a file you always need to check whether there is more to parse:
try {
BufferedReader oReader = new BufferedReader(oFile);
String strLine;
while (true) {
strLine = oReader.readLine()
if(strLine==null) break;
process(strLine);
}
oReader.close();
}
catch (IOException e) {
}