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
I know this is an old answer but for future Googlers:
I would recommend JavaREPL whose source is available here: https://github.com/albertlatacz/java-repl
What AlmightyR is asking for is called Read-Eval-Print-Loop (REPL) for the Java language which is what JavaREPL provides.
JavaREPL has an online demo available here: http://www.javarepl.com/console.html
JavaREPL also has an Intellij plugin and a CLI version which are both linked to in the Github repository.
It looks sort of abandoned currently but perhaps it just doesn't need to be maintained?