Assume your speaking about dev environment?
And what is goal here - compile ONLY or compile and deploy to app server?
If your classes are being picked up frm same place as compilation then thats a best practice - you could adjust your build and deploy so its compiled in to your workspace but then classes are copied to a ..../deploy folder in correct structure and the app server picks them from there. this way no lock from running app. can compile and not deploy at will. If you want to hot deploy and they are classes not in a jar it might be possible - jvm shpould not put a lock on classes.