.java scripts with
jbang you can pass the
--debug-flag and the script will enable debug,
suspend the execution and wait until you connect a debugger to port 4004.
jbang --debug helloworld.java Listening for transport dt_socket at address: 4004
You can change the debug port and host by passing in a interface pattern and number to the debug argument, e.g.,
This will make it use port 4321 and make it listen on all ('*') network interfaces.
|Be sure to put a breakpoint in your IDE/debugger before you connect to make the debugger actually stop when you need it.|