For example, we can enable java remote debug by adding following to command line.
The address property specifies host (optionally) and port (only the port if host is left out). So
address=5005 specifies the port 5005 in your case. If you want your program to wait until you connect your debugger, switch
Edit: Maybe I misunderstood your question. In case you want to enable debugging programmatically, this won't be possible as the debugging facility JPDA is not exposing a Java API nor any other way to start and stop it programmatically.