It's impossible to answer this question. We don't know what kind of computer you have (slow? fast? how much memory?), which operating system you are using, what version of Java you are using, etc. Maybe you have a virus or spyware on your computer that's doing nasty things? There can be a thousand reasons for this...
Once again, you have said nothing about your problem,
we cant help you if we dont know any thing.
its like going to a doctor and saying i am not well and then just standing there quietly saying nothing
Possible problems with hanging:
1. infinite loops
2. recursive programs (they do throw out of stack, but sometimes the pc hangs up)
3. slow IO (may be program is waiting for something to happen)
if your pc is hanging during compilation,
1. is your pc config good enough to support the program (i think javac may take quite a while in a 128 mb ram)
2. Are you using a memory hungry IDE (Eclipse /netbeans may almost hang in 128 or 64 mb ram during compilation)
3. Are you compiling just your file or all files : or ?