It should be a simple matter of adding these modules to the --addModules list. See line 1086 of the following file:
https://github.com/processing/processing4/blob/3185ebae15f1ee894a9a2a056cc253b4677012e3/java/src/processing/mode/java/JavaBuild.java
Addendum:
I just ran your code in Processing 4.1.2 on a Mac and it runs without error.