I want to be able to input java commands/code to execute during run-time (during the execution of a \"persistent\" program) in the same way, or as close as possible, to the same
You can use JavaCompiler, as this question's answer states:
https://stackoverflow.com/a/935316/420001
Also, what you're wanting to do is evaluate a String of code:
evaluate
String
code
It's not really recommended though.