The generated classes can be debugged interactively, even though they were created on-the-fly.
All that needs to be done is set two system properties, e.g. when starting the JVM:
(The second property is optional; if not set, then the temporary files will be created in the default temporary-file directory.)
When JANINO scans an expression, script, class body or compilation unit, it stores a copy of the source code in a temporary file which the debugger accesses through its source path. (The temporary file will be deleted when the JVM terminates.)
Then when you debug your program
, you can step right into the generated code
, and debug it:
As you can see, you can even inspect and modify fields and variables - everything your debugger supports.