As written, if the first argument is "-i", then you'll be prompted for input; but if it's not, then the program will read a line from the console without prompting. Is that what you intend? Is it "hanging" just because it's waiting for that one line?
There can actually be some issues with data gettting "stuck" when you use BufferedReader with System.in. You always need to turn buffering off by using a 1-character buffer (I added text in bold):