Just pass -src
as many times as you need it:
-src src/ -src widgets/
The modules comes last on the command line, and are looked up in all source folders and the classpath:
-src src/ -src widgets/ com.my.Project.MyProject
Note that only modules with an <entry-point>
(or inheriting a module that has an <entry-point>
) can be passed that way on the command line; without entry-point the module is only a "library" to be inherited by other modules, not an "application".
Note, you could also just add all your source folders to the classpath, instead of using -src
.