To debug a UDR written in Java code, you can connect the Java debugger, jdb, to the embedded JVM for debugging. The agent password that jdb requires is printed in the message log.